| <?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="components/Text/Events/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="Text_main.mxml"> |
| <!-- this set of lines form a template that must be in each unit test --> |
| <mx:Script> |
| <![CDATA[ |
| |
| |
| public static function init(o:DisplayObject):void |
| { |
| } |
| |
| |
| ]]> |
| </mx:Script> |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| <!-- end of set of lines that must be in each unit test --> |
| <mx:Script> |
| <![CDATA[ |
| import mx.controls.Text; |
| public function scriptFunction(a:String, b:int):String |
| { |
| return a + ":" + b.toString(); |
| } |
| ]]> |
| </mx:Script> |
| <testCases> |
| |
| <TestCase testID="Text_events_hide" keywords="[events, hide, Text]" description="Testing the hide event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| </setup> |
| <body> |
| <SetProperty target="myText" propertyName="visible" value="false" waitEvent="hide" waitTarget="myText"/> |
| <AssertEvent target="myText" eventName="hide" eventClass="mx.events::FlexEvent" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Text_events_show" keywords="[events, show, Text]" description="Testing the show event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| </setup> |
| <body> |
| <SetProperty target="myText" propertyName="visible" value="false"/> |
| <SetProperty target="myText" propertyName="visible" value="true" waitEvent="show" waitTarget="myText"/> |
| <AssertEvent target="myText" eventName="show" eventClass="mx.events::FlexEvent" /> |
| </body> |
| </TestCase> |
| <!-- |
| <TestCase testID="Text_events_click" keywords="[events, click, Text]" description="Testing the click event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| </setup> |
| <body> |
| <DispatchMouseClickEvent target="myText" localX="10" localY="10"/> |
| <AssertEvent target="myText" eventName="click" eventClass="flash.events::MouseEvent"/> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="Text_events_mouseOver" keywords="[events, mouseOver, Text]" description="Testing the mouseOver event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseOver" target="myText" localX="10" localY="10"/> |
| <AssertEvent target="myText" eventName="mouseOver" eventClass="flash.events::MouseEvent"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Text_events_mouseMove" keywords="[events, mouseMove, Text]" description="Testing the mouseMove event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseMove" target="myText" localX="10" localY="10"/> |
| <AssertEvent target="myText" eventName="mouseMove" eventClass="flash.events::MouseEvent"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Text_events_mouseOut" keywords="[events, mouseOut, Text]" description="Testing the mouseOut event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseOver" target="myText" localX="10" localY="10"/> |
| <DispatchMouseEvent type="mouseMove" target="myText" localX="20" localY="20"/> |
| <DispatchMouseEvent type="mouseOut" target="myText" localX="20" localY="20"/> |
| <AssertEvent target="myText" eventName="mouseOut" eventClass="flash.events::MouseEvent"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Text_events_mouseDown" keywords="[events, mouseDown, Text]" description="Testing the mouseDown event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseDown" target="myText" localX="10" localY="10"/> |
| <AssertEvent target="myText" eventName="mouseDown" eventClass="flash.events::MouseEvent"/> |
| <DispatchMouseEvent type="mouseUp" target="myText" localX="10" localY="10"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Text_events_mouseUp" keywords="[events, mouseUp, Text]" description="Testing the mouseUp event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| </setup> |
| <body> |
| <DispatchMouseEvent type="mouseDown" target="myText" localX="10" localY="10"/> |
| <DispatchMouseEvent type="mouseUp" target="myText" localX="10" localY="10"/> |
| <AssertEvent target="myText" eventName="mouseUp" eventClass="flash.events::MouseEvent"/> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="Text_events_toolTipShow" keywords="[events, toolTipShow, Inherited, Text]" description="Testing the toolTipShow event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| <SetProperty target="myText" propertyName="toolTip" value="My Text"/> |
| |
| </setup> |
| <body> |
| <DispatchMouseEvent target="myText" type="mouseOver" localX="10" localY="10"/> |
| <AssertEvent target="myText" eventName="toolTipShow" eventClass="mx.events::ToolTipEvent" timeout="10000"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Text_events_toolTipHide" keywords="[events, toolTipHide, Inherited, Text]" description="Testing the toolTipHide event for Text"> |
| <setup> |
| <ResetComponent target="myText" className="mx.controls::Text" waitEvent="updateComplete" waitTarget="myText"/> |
| <SetProperty target="myText" propertyName="htmlText" value="I am a plain Text" /> |
| <SetProperty target="myText" propertyName="toolTip" value="My Text"/> |
| |
| </setup> |
| <body> |
| <DispatchMouseEvent target="myText" type="mouseOver" localX="10" localY="10"/> |
| <AssertEvent target="myText" eventName="toolTipHide" eventClass="mx.events::ToolTipEvent" timeout="50000"/> |
| </body> |
| </TestCase> |
| --> |
| </testCases> |
| </UnitTester> |