| <?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="apollo/spark/components/WindowedApplication/methods/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="wa_app2.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.core.FlexGlobals; |
| import spark.components.*; |
| |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <!-- |
| ======================================================== |
| move method |
| In mustella, we can't tell whether the window moves |
| to the right place, so there are manual tests for that. |
| But at least we can move the window around, verify |
| the move event, and be sure it doesn't RTE. |
| |
| Note SDK-22266: there is no move event. If that ends |
| up being NAB, we'll have to use Pause. Doh! |
| ======================================================== |
| --> |
| <TestCase testID="move_test1" keywords="[WindowedApplication,move]" description="-10, -10" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.move(-10, -10)" /> |
| <AssertEvent target="" eventName="windowMove" eventClass="mx.events::FlexNativeWindowBoundsEvent" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="x" value="-10" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="y" value="-10" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="move_test2" keywords="[WindowedApplication,move]" description="-1, -1" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.move(-1, -1)" /> |
| <AssertEvent target="" eventName="windowMove" eventClass="mx.events::FlexNativeWindowBoundsEvent" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="x" value="-1" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="y" value="-1" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="move_test3" keywords="[WindowedApplication,move]" description="0, 0" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.move(0, 0)" /> |
| <AssertEvent target="" eventName="windowMove" eventClass="mx.events::FlexNativeWindowBoundsEvent" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="x" value="0" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="y" value="0" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="move_test4" keywords="[WindowedApplication,move]" description="1, 1" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.move(1, 1)" /> |
| <AssertEvent target="" eventName="windowMove" eventClass="mx.events::FlexNativeWindowBoundsEvent" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="x" value="1" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="y" value="1" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="move_test5" keywords="[WindowedApplication,move]" description="100, 300" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.move(100, 300)" /> |
| <AssertEvent target="" eventName="windowMove" eventClass="mx.events::FlexNativeWindowBoundsEvent" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="x" value="100" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="y" value="300" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="move_test6" keywords="[WindowedApplication,move]" description="screen x, screen y" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.move(flash.system.Capabilities.screenResolutionX, flash.system.Capabilities.screenResolutionY)" /> |
| <AssertEvent target="" eventName="windowMove" eventClass="mx.events::FlexNativeWindowBoundsEvent" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="x" valueExpression="value = flash.system.Capabilities.screenResolutionX" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="y" valueExpression="value = flash.system.Capabilities.screenResolutionY" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="move_test7" keywords="[WindowedApplication,move]" description="screen x + 10, screen y + 10" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.doReset()" waitTarget="" waitEvent="resetComplete" /> |
| </setup> |
| <body> |
| <RunCode code="FlexGlobals.topLevelApplication.move(flash.system.Capabilities.screenResolutionX + 10, flash.system.Capabilities.screenResolutionY + 10)" /> |
| <AssertEvent target="" eventName="windowMove" eventClass="mx.events::FlexNativeWindowBoundsEvent" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="x" valueExpression="value = flash.system.Capabilities.screenResolutionX + 10" /> |
| <AssertPropertyValue target="nativeWindow.bounds" propertyName="y" valueExpression="value = flash.system.Capabilities.screenResolutionY + 10" /> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |