| <?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="Mirroring/styles/" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:m="http://ns.adobe.com/mxml/2009" xmlns="*" testSWF="Mirroring_Main.mxml"> |
| <!-- this set of lines form a template that must be in each unit test --> |
| <fx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void { } |
| ]]> |
| </fx:Script> |
| <fx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </fx:Metadata> |
| <!-- end of set of lines that must be in each unit test --> |
| <fx:Script> |
| <![CDATA[ |
| ]]> |
| </fx:Script> |
| <testCases> |
| |
| <TestCase testID="Mirroring_layoutDirection_default" keywords="[Mirroring, layoutDirection]" description="Check the default value of the layoutDirection style."> |
| <setup> |
| <ResetComponent target="vgroup1" className="comps.VGroupComp" waitEvent="updateComplete" waitTarget="vgroup1"/> |
| </setup> |
| <body> |
| <AssertStyleValue target="vgroup1" styleName="layoutDirection" value="ltr" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Mirroring_layoutDirection_RTL_runtime" keywords="[Mirroring, layoutDirection]" description="Set the layoutDirection style to rtl at runtime."> |
| <setup> |
| <ResetComponent target="vgroup1" className="comps.VGroupComp" waitEvent="updateComplete" waitTarget="vgroup1"/> |
| </setup> |
| <body> |
| <SetStyle target="vgroup1" styleName="layoutDirection" value="rtl" waitEvent="updateComplete" /> |
| <AssertStyleValue target="vgroup1" styleName="layoutDirection" value="rtl" /> |
| <AssertMethodValue method="value=application.convertXY(application.vgroup1.check1.skin.labelDisplay).x" value="327" /> |
| <AssertMethodValue method="value=application.convertXY(application.vgroup1.check1.skin.labelDisplay).y" value="5" /> |
| <AssertMethodValue method="value=application.convertXY(application.vgroup1.slider1.skin.thumb).x" value="400" /> |
| <AssertMethodValue method="value=application.convertXY(application.vgroup1.slider1.skin.thumb).y" value="24" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Mirroring_layoutDirection_setInCSS" keywords="[Mirroring, layoutDirection]" description="Check that setting layoutDirection works when set in CSS."> |
| <setup> |
| <ResetComponent target="vgroup1" className="comps.VGroupComp" waitEvent="updateComplete" waitTarget="vgroup1"/> |
| </setup> |
| <body> |
| <RunCode code="application.addCanvasComp(0)" waitTarget="" waitEvent="added" /> |
| <Pause timeout="1000" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).dateField1).x" value="491" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).image1).x" value="390" /> |
| |
| </body> |
| </TestCase> |
| <TestCase testID="Mirroring_layoutDirection_addElement" keywords="[Mirroring, layoutDirection]" description="Add a component with layoutDirection=ltr to an Application with layoutDirection set to rtl."> |
| <setup> |
| <ResetComponent target="vgroup1" className="comps.VGroupComp" waitEvent="updateComplete" waitTarget="vgroup1"/> |
| </setup> |
| <body> |
| <SetStyle target="" styleName="direction" value="rtl" /> |
| <SetStyle target="" styleName="layoutDirection" value="rtl" /> |
| <Pause timeout="400" /> |
| <RunCode code="application.addCanvasComp(1)" waitTarget="" waitEvent="validateDisplayListComplete" /> |
| <Pause timeout="1000" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).dateField1).x" value="409" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).image1).x" value="410" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Mirroring_RTLlayoutDirection_XYBasicLayout" keywords="[Mirroring, layoutDirection]" description="Test x and y values in a BasicLayout when layoutDirection=rtl."> |
| <setup> |
| <SetStyle target="" styleName="direction" value="ltr" /> |
| <SetStyle target="" styleName="layoutDirection" value="ltr" /> |
| <ResetComponent target="vgroup1" className="comps.VGroupComp" waitEvent="updateComplete" waitTarget="vgroup1"/> |
| </setup> |
| <body> |
| <RunCode code="application.addCanvasComp(2)" waitTarget="" waitEvent="elementAdd" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).slider1).x" value="639" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).slider1).y" value="256" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Mirroring_RTLlayoutDirection_right_BasicLayout" keywords="[Mirroring, layoutDirection]" description="Test right constraint values in a BasicLayout when layoutDirection=rtl."> |
| <setup> |
| <SetStyle target="" styleName="direction" value="ltr" /> |
| <SetStyle target="" styleName="layoutDirection" value="ltr" /> |
| <ResetComponent target="vgroup1" className="comps.VGroupComp" waitEvent="updateComplete" waitTarget="vgroup1"/> |
| </setup> |
| <body> |
| <RunCode code="application.addCanvasComp(2)" waitTarget="" waitEvent="elementAdd" /> |
| <Pause timeout="1000" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).check1).x" value="354" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).check1).y" value="221" /> |
| </body> |
| </TestCase> |
| <TestCase testID="Mirroring_RTLlayoutDirection_left_BasicLayout" keywords="[Mirroring, layoutDirection]" description="Test left constraint values in a BasicLayout when layoutDirection=rtl."> |
| <setup> |
| <SetStyle target="" styleName="direction" value="ltr" /> |
| <SetStyle target="" styleName="layoutDirection" value="ltr" /> |
| <ResetComponent target="vgroup1" className="comps.VGroupComp" waitEvent="updateComplete" waitTarget="vgroup1"/> |
| </setup> |
| <body> |
| <RunCode code="application.addCanvasComp(2)" waitTarget="" waitEvent="elementAdd" /> |
| <Pause timeout="1000" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).image1).x" value="549" /> |
| <AssertMethodValue method="value=application.convertXY(application.getElementAt(1).image1).y" value="279" /> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |