| <?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/properties/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="window_basic_002.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.*; |
| import mx.binding.utils.*; |
| import comps.*; |
| |
| |
| public function setBinding():void |
| { |
| BindingUtils.bindProperty( FlexGlobals.topLevelApplication.info, "text", FlexGlobals.topLevelApplication.myWin, "backgroundColor" ); |
| |
| |
| } |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <!-- |
| ======================================================== |
| Test backgroundColor. |
| ======================================================== |
| --> |
| <TestCase testID="backgroundColor_test1" keywords="[Window,backgroundColor]" description="default value should be 0xFFFFFF" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" /> |
| </setup> |
| <body> |
| <AssertPixelValue target="myWin" x="100" y="100" value="0xFFFFFF"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="backgroundColor_test2" keywords="[Window,backgroundColor]" description="Set backgroundColor value" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="myWin" styleName="backgroundColor" value="0x00FF00" waitEvent="updateComplete" /> |
| <MyCompareBitmap target="myWin" url="../properties/baselines/$testID.png" mac_url="../properties/baselines/$testID_mac.png"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="backgroundColor_test3" keywords="[Window,backgroundColor]" description="Set backgroundColor to different value" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <WaitForEvent target="stage" eventName="enterFrame" numExpectedEvents="2"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" /> |
| </setup> |
| <body><!-- url="../properties/baselines/$testID.png" --> |
| <SetStyle target="myWin" styleName="backgroundColor" value="0x0000FF" waitEvent="updateComplete" /> |
| <MyCompareBitmap target="myWin" url="../properties/baselines/$testID.png" mac_url="../properties/baselines/$testID_mac.png"/> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| </body> |
| </TestCase> |
| <TestCase testID="backgroundColor_test4" keywords="[Window,backgroundColor]" description="get backgroundColor to different value" > |
| <setup> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| <RunCode code="FlexGlobals.topLevelApplication.createAWindow()" waitTarget="" waitEvent="myWindowComplete" /> |
| </setup> |
| <body> |
| <SetStyle target="myWin" styleName="backgroundColor" value="0x0000FF" waitEvent="updateComplete" /> |
| <AssertMethodValue method="value=FlexGlobals.topLevelApplication.myWin.getStyle('backgroundColor')" value="0x0000FF" /> |
| <RunCode code="FlexGlobals.topLevelApplication.closeAllChildWindow()"/> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |