| <?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="Managers/PopUpManager/Methods/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="PopUpManager_Basic_spark.mxml"> |
| |
| <mx:Script> |
| <![CDATA[ |
| |
| import mx.managers.PopUpManager; |
| public static function init(o:DisplayObject):void |
| { |
| |
| } |
| |
| public function cleanUpPopUps(): void |
| { |
| if(application.parent.numChildren > 1) |
| { |
| var popups:int = application.parent.popUpChildren.numChildren; |
| if(popups > 0) |
| { |
| for (var i:int=0; i<popups; i++) |
| { |
| application.parent.removeChild(application.parent.popUpChildren.getChildAt(i)); |
| } |
| } |
| } |
| } |
| |
| ]]> |
| </mx:Script> |
| |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| |
| <testCases> |
| |
| <TestCase testID="PopUpManager_centerPopUp_nonmodal" description="Test the centerPopUp method for a non-modal popup" keywords="[centerPopUp, PopUpManager]"> |
| <setup> |
| <!--RunCode code="cleanUpPopUps()" /--> |
| <WaitForEffectsToEnd /> |
| <Pause timeout="2000"/> |
| <RunCode code="application.openWindow4(false)" waitTarget="canvasPopUp" waitEvent="updateComplete" /> |
| <AssertPropertyValue propertyName="y" target="canvasPopUp" value="3333" /> |
| </setup> |
| <body> |
| <SetProperty propertyName="x" target="canvasPopUp" value="0" waitTarget="canvasPopUp" waitEvent="move"/> |
| <RunCode code="application.centerMyPopUp()" waitTarget="canvasPopUp" waitEvent="move" /> |
| <AssertPropertyValue propertyName="x" target="canvasPopUp" value="200" /> |
| <AssertPropertyValue propertyName="y" target="canvasPopUp" value="225" /> |
| <RunCode code="PopUpManager.removePopUp(application.canvasPopUp)" /> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |