| <?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/Window/methods/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="window_basic_005.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 flash.system.Capabilities; |
| import mx.core.FlexGlobals; |
| import spark.components.*; |
| import spark.skins.spark.*; |
| |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <!-- |
| ======================================================== |
| Test minimize() |
| - The minimizable property is tested elsewhere. Here, |
| we're just testing that minimmize() minimizes, which is |
| a similar, partly duplicated, set of tests. |
| - Clicking the minimize button to minimize is also |
| tested in the minimizable tests. |
| - There's not much we can do (e.g. CompareBitmap |
| and such) in mustella. There will be manual tests. |
| ======================================================== |
| --> |
| |
| <TestCase testID="minimize_test1_SparkChrome" keywords="[Window,minimize]" description="Minimize when in the restored state." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/> |
| </setup> |
| <body> |
| <SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/> |
| <AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="minimize_test1_WindowedApplicationSkin" keywords="[Window,minimize]" description="Minimize when in the restored state." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/> |
| </setup> |
| <body> |
| <SetStyle target="windowObj" styleName="skinClass" valueExpression="value = WindowedApplicationSkin" /> |
| <WaitForLayoutManager /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/> |
| <AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" /> |
| </body> |
| </TestCase> |
| |
| |
| |
| |
| <TestCase testID="minimize_test2_SparkChrome" keywords="[Window,minimize]" description="Minimize when maximized." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/> |
| </setup> |
| <body> |
| <SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" /> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/> |
| <AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="minimize_test2_WindowedApplicationSkin" keywords="[Window,minimize]" description="Minimize when maximized." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/> |
| </setup> |
| <body> |
| <SetStyle target="windowObj" styleName="skinClass" valueExpression="value = WindowedApplicationSkin" /> |
| <WaitForLayoutManager /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.maximize()" waitTarget="windowObj" waitEvent="displayStateChange" /> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" /> |
| <WaitForLayoutManager /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/> |
| <AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" /> |
| </body> |
| </TestCase> |
| |
| |
| |
| <TestCase testID="minimize_test3_SparkChrome" keywords="[Window,minimize]" description="Minimize when minimized. We must use Pause." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/> |
| </setup> |
| <body> |
| <SetStyle target="windowObj" styleName="skinClass" valueExpression="value = SparkChromeWindowedApplicationSkin" waitEvent="updateComplete" /> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" /> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/> |
| <AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="minimize_test3_WindowedApplicationSkin" keywords="[Window,minimize]" description="Minimize when minimized. We must use Pause." > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete"/> |
| </setup> |
| <body> |
| <SetStyle target="windowObj" styleName="skinClass" valueExpression="value = WindowedApplicationSkin" /> |
| <WaitForLayoutManager /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" waitTarget="windowObj" waitEvent="displayStateChange" /> |
| <RunCode code="FlexGlobals.topLevelApplication.windowObj.minimize()" /> |
| <WaitForLayoutManager /> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="4"/> |
| <AssertPropertyValue target="windowObj.nativeWindow" propertyName="displayState" value="minimized" /> |
| </body> |
| </TestCase> |
| |
| |
| </testCases> |
| </UnitTester> |