| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <UnitTester testDir="mobile/components/TextArea/Methods/" |
| xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:mx="library://ns.adobe.com/flex/mx" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns="*" |
| testSWF="TextArea1.mxml"> |
| |
| <!-- this set of lines form a template that must be in each unit test --> |
| <fx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void |
| { |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </fx:Metadata> |
| <!-- end of set of lines that must be in each unit test --> |
| |
| <fx:Script> |
| <![CDATA[ |
| import components.*; |
| import mx.core.FlexGlobals; |
| import mx.utils.StringUtil; |
| import spark.components.TextArea; |
| import spark.components.supportClasses.*; |
| import spark.skins.mobile.*; |
| |
| private var text:String = "One two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty twenty-one twenty-two twenty-three twenty-four twenty-five twenty-six twenty-seven twenty-eight twenty-nine thirty thirty-one thirty-two thirty-three thirty-four thirty-five thirty-six thirty-seven."; |
| |
| ]]> |
| |
| </fx:Script> |
| |
| |
| <testCases> |
| |
| <!-- Note that the selectionChange event does not fire (known bug), so we use pauses. --> |
| |
| <!-- ******************** insertText() ******************** --> |
| <TestCase testID="TextArea_insertText_test1" keywords="[TextArea, insertText]" description="Insert text into an empty field." > |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.insertText('Silver Musician')" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="Silver Musician"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_insertText_test2" keywords="[TextArea, insertText]" description="Select all, then insert text." > |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="Dummy text" waitEvent="updateComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectAll()" /> |
| <Pause timeout="100" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.insertText('Silver Musician')" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="Silver Musician"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_insertText_test3" keywords="[TextArea, insertText]" description="Select some, then insert text."> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="Silver Musician" waitEvent="updateComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(4,5)" /> |
| <Pause timeout="100"/> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.insertText('eth')" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="Silvethr Musician"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_insertText_test4" description="Insert text at the beginning." keywords="[TextArea, insertText]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="Dummy text" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(0,0)" /> |
| <Pause timeout="100" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.insertText('pre ')" /> |
| <Pause timeout="200" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="pre ummy text"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_insertText_test5" description="Insert text at the end." keywords="[TextArea, insertText]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="Dummy text" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(10,10)" /> |
| <Pause timeout="100" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.insertText(' post')" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="Dummy text post" /> |
| </body> |
| </TestCase> |
| |
| <!-- ******************** appendText() ******************** --> |
| <TestCase testID="TextArea_appendText_test1" description="Append text to existing text" keywords="[TextArea, appendText]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.appendText(' jumped over the lazy dog')" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog"/> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="44" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="44" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_appendText_test2" description="Append text to empty field" keywords="[TextArea, appendText]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.appendText('The quick brown fox')" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="The quick brown fox"/> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="19" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="19" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_appendText_test3" description="Append empty string" keywords="[TextArea, appendText]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.appendText('')" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="The quick brown fox"/> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="19" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="19" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_appendText_test4" description="Append text multiple times" keywords="[TextArea, appendText]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="trace('1')" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.appendText('The quick brown fox')" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <RunCode code="trace('2')" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="The quick brown fox"/> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="19" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="19" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.appendText('The quick brown fox')" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="38" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="38" /> |
| </body> |
| </TestCase> |
| |
| |
| <!-- No scroller for mobile yet. --> |
| |
| <!-- No scroller for mobile yet. --> |
| <TestCase testID="TextArea_appendText_test_longText" description="..." keywords="[TextArea, appendText]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="151" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.appendText('The\nQuick\nBrown\nFox\nJumps\nOver\nThe\nLazy\nDog:END')" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <AssertPropertyValue target="tac1.ta1.scroller.viewport" propertyName="verticalScrollPosition"> |
| <ConditionalValue deviceDensity="160" value="45" /> |
| <ConditionalValue deviceDensity="240" value="174" /> |
| <ConditionalValue deviceDensity="320" value="218" /> |
| <ConditionalValue deviceDensity="320" os="ios" value="275" /> |
| </AssertPropertyValue> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="47" > |
| <ConditionalValue deviceDensity="160" value="47" /> |
| <ConditionalValue deviceDensity="240" value="47" /> |
| <ConditionalValue deviceDensity="320" value="47" /> |
| </AssertPropertyValue> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="47" > |
| <ConditionalValue deviceDensity="160" value="47" /> |
| <ConditionalValue deviceDensity="240" value="47" /> |
| <ConditionalValue deviceDensity="320" value="47" /> |
| </AssertPropertyValue> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_appendText_test5" description="Append text in the beginning multiple times" keywords="[TextArea, appendText]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.appendText('The quick brown fox')" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="The quick brown fox"/> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="19" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="19" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(0,0)" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.appendText(' jumped over the lazy dog')" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog"/> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="44" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="44" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_appendText_test6" description="Append text when text is selected" keywords="[TextArea, appendText]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectAll()" /> |
| <Pause timeout="100" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.appendText(' jumped over the lazy dog')" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| |
| <AssertPropertyValue target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog"/> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="44" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="44" /> |
| </body> |
| </TestCase> |
| |
| <!-- ******************** scrollToRange() ******************** --> |
| <!-- No scroller yet. --> |
| <TestCase testID="TextArea_scrollToRange1" description="Scroll to the middle of the text" keywords="[TextArea, scrollToRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView4)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac4" className="components.TextAreaComp4" waitEvent="updateComplete" /> |
| <SetProperty target="tac4.ta1" propertyName="height" value="300" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac4.ta1.scrollToRange(900, 905)" /> |
| <Pause timeout="100"/> |
| <RunCode code="trace(FlexGlobals.topLevelApplication.tac4.ta1.scroller.viewport.verticalScrollPosition)" /> |
| <AssertPropertyValue target="tac4.ta1.scroller.viewport" propertyName="verticalScrollPosition" > |
| <ConditionalValue deviceDensity="160" value="543.6" /> |
| <ConditionalValue deviceDensity="240" value="843" /> |
| <ConditionalValue deviceDensity="320" value="1033.2" /> |
| <ConditionalValue deviceDensity="320" os="ios" value="1062" /> |
| </AssertPropertyValue> |
| <CompareBitmap numColorVariances="5" maxColorVariance="16" url="../Methods/baselines" target="tac4.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_scrollToRange2" description="Scroll to the bottom of the text" keywords="[TextArea, scrollToRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView4)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac4" className="components.TextAreaComp4" waitEvent="updateComplete" /> |
| <SetProperty target="tac4.ta1" propertyName="height" value="300" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac4.ta1.scrollToRange(1800, 1805)" /> |
| <Pause timeout="100"/> |
| <RunCode code="trace(FlexGlobals.topLevelApplication.tac4.ta1.scroller.viewport.verticalScrollPosition)" /> |
| <AssertPropertyValue target="tac4.ta1.scroller.viewport" propertyName="verticalScrollPosition" > |
| <ConditionalValue deviceDensity="160" value="843" /> |
| <ConditionalValue deviceDensity="240" value="1481" /> |
| <ConditionalValue deviceDensity="320" value="1872" /> |
| <ConditionalValue deviceDensity="320" os="ios" value="1948" /> |
| </AssertPropertyValue> |
| <CompareBitmap url="../Methods/baselines" target="tac4.ta1" numColorVariances="80" ignoreMaxColorVariance="true"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_scrollToRange3" description="Scroll to the top of the text" keywords="[TextArea, scrollToRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView4)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac4" className="components.TextAreaComp4" waitEvent="updateComplete" /> |
| <SetProperty target="tac4.ta1" propertyName="height" value="300" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac4.ta1.scrollToRange(0, 5)" /> |
| <Pause timeout="100"/> |
| <RunCode code="trace(FlexGlobals.topLevelApplication.tac4.ta1.scroller.viewport.verticalScrollPosition)" /> |
| <AssertPropertyValue target="tac4.ta1.scroller.viewport" propertyName="verticalScrollPosition" value="0" /> |
| <CompareBitmap numColorVariances="5" maxColorVariance="16" url="../Methods/baselines" target="tac4.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <!-- ******************** selectRange() and selectAll()) ******************** --> |
| <!-- We need a pause b/c there is no event which occurs when selection highlighting finishes. There's an event for it, but we don't dispatch it on mobile. --> |
| <TestCase testID="TextArea_selectAll_test1" description="Select all" keywords="[TextArea, selectRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog." waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <DispatchMouseClickEvent target="tac1.ta1" localX="15" localY="15" waitEvent="focusIn" waitTarget="tac1.ta1" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectAll()" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="0" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="45" /> |
| <CompareBitmap numColorVariances="20" ignoreMaxColorVariance="true" url="../Methods/baselines" target="tac1.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_selectRange_test1" description="-1, -1" keywords="[TextArea, selectRange]"> |
| <bugs> |
| <Bug bugID="SDK-27972" /> |
| </bugs> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog." waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <DispatchMouseClickEvent target="tac1.ta1" localX="15" localY="15" waitEvent="focusIn" waitTarget="tac1.ta1" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(-1,-1)" /> |
| <Pause timeout="100" /> |
| <!--AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="-1" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="-1" /--> |
| <CompareBitmap numColorVariances="100" ignoreMaxColorVariance="true" url="../Methods/baselines" target="tac1.ta1" > |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_selectRange_test2" description="NaN" keywords="[TextArea, selectRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog." waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.setFocus()" waitTarget="tac1.ta1" /> |
| |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(NaN,NaN)" waitTarget="tac1.ta1" /> |
| <Pause timeout="10000" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="0" /> |
| <!--<AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="0" />--> |
| <CompareBitmap numColorVariances="100" ignoreMaxColorVariance="true" url="../Methods/baselines" target="tac1.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_selectRange_test3" description="10, 10" keywords="[TextArea, selectRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog." waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <DispatchMouseClickEvent target="tac1.ta1" localX="15" localY="15" waitEvent="focusIn" waitTarget="tac1.ta1" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(10,10)" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="10" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="10" /> |
| <CompareBitmap numColorVariances="100" ignoreMaxColorVariance="true" url="../Methods/baselines" target="tac1.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_selectRange_test4" description="Ascending" keywords="[TextArea, selectRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog." waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <DispatchMouseClickEvent target="tac1.ta1" localX="15" localY="15" waitEvent="focusIn" waitTarget="tac1.ta1" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(5,10)" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="5" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="10" /> |
| <CompareBitmap numColorVariances="20" maxColorVariance="16" url="../Methods/baselines" target="tac1.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_selectRange_test5" description="Descending, note that these results differ from desktop b/c we are using the older Flash TextField." keywords="[TextArea, selectRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog." waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <DispatchMouseClickEvent target="tac1.ta1" localX="15" localY="15" waitEvent="focusIn" waitTarget="tac1.ta1" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(10,5)" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="5" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="10" /> |
| <CompareBitmap numColorVariances="20" maxColorVariance="16" url="../Methods/baselines" target="tac1.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_selectRange_test6" description="Anchor only" keywords="[TextArea, selectRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog." waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <DispatchMouseClickEvent target="tac1.ta1" localX="15" localY="15" waitEvent="focusIn" waitTarget="tac1.ta1" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(10, int.MAX_VALUE)" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="10" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="45" /> |
| <CompareBitmap numColorVariances="20" maxColorVariance="16" url="../Methods/baselines" target="tac1.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_selectRange_test7" description="Anchor is NaN" keywords="[TextArea, selectRange]"> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog." waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <DispatchMouseClickEvent target="tac1.ta1" localX="15" localY="15" waitEvent="focusIn" waitTarget="tac1.ta1" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectRange(NaN, 10)" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="0" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="10" /> |
| <CompareBitmap numColorVariances="20" maxColorVariance="16" url="../Methods/baselines" target="tac1.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="TextArea_selectRange_test8" description="Set text after selecting text." keywords="[TextArea, selectRange, method, SDK-16435]"> |
| <bugs> |
| <Bug bugID="SDK-27974" /> |
| </bugs> |
| <setup> |
| <!--<RunCode code="FlexGlobals.topLevelApplication.doPopAll()" waitTarget="navigator" waitEvent="viewChangeComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.navigator.pushView(components.TextAreaView1)" waitTarget="navigator" waitEvent="viewChangeComplete" />--> |
| <ResetComponent target="tac1" className="components.TextAreaComp1" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="width" value="300" /> |
| <SetProperty target="tac1.ta1" propertyName="height" value="200" waitEvent="updateComplete" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="The quick brown fox jumped over the lazy dog." waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <DispatchMouseClickEvent target="tac1.ta1" localX="15" localY="15" waitEvent="focusIn" waitTarget="tac1.ta1" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.tac1.ta1.selectAll()" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="0" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="45" /> |
| <SetProperty target="tac1.ta1" propertyName="text" value="Silver Musician" waitTarget="tac1.ta1" waitEvent="updateComplete" /> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionAnchorPosition" value="0" /> |
| <AssertPropertyValue target="tac1.ta1" propertyName="selectionActivePosition" value="15" /> |
| <CompareBitmap numColorVariances="5" maxColorVariance="16" url="../Methods/baselines" target="tac1.ta1"> |
| <ConditionalValue deviceDensity="160" /> |
| <ConditionalValue deviceDensity="240" /> |
| <ConditionalValue deviceDensity="320" /> |
| <ConditionalValue deviceDensity="320" os="ios" /> |
| <ConditionalValue deviceDensity="160" os="qnx" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| |
| </UnitTester> |