| <?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="containers/DividedBox/Styles/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="DivBoxMain_spark.mxml"> |
| <mx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void |
| { |
| } |
| ]]> |
| </mx:Script> |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| <mx:Script> |
| <![CDATA[ |
| import mx.styles.StyleManager; |
| import mx.managers.SystemManager; |
| import mx.managers.CursorManager; |
| import Assets.MySmallUpSkin; |
| import Assets.MyHCursor; |
| import Assets.MyVCursor; |
| |
| private function getCursor():int{ |
| return (CursorManager.currentCursorID); |
| } |
| ]]> |
| </mx:Script> |
| |
| <testCases> |
| |
| <TestCase testID="div_style_dividerAffordance_default_spark" keywords="[DividedBox,style,dividerAffordance, default]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitEvent="updateComplete" waitTarget="div"/> |
| <ResetComponent target="myDB" className="mx.containers.DividedBox" waitEvent="updateComplete" waitTarget="myDB"/> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete" /> |
| <RunCode code="application.div.setStyle('verticalGap',30);" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <DispatchMouseEvent target="div" localX="250" localY="258" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="250" localY="258" type="mouseDown"/> |
| <WaitForEffectsToEnd /> |
| <AssertMethodValue method="value=getCursor()" value="0"/> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitEvent="updateComplete" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown"/> |
| <DispatchMouseEvent target="div" localX="250" localY="286" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="301" localY="281" type="mouseUp"/> |
| <AssertPropertyValue target="div.myp" propertyName="height" value="238" /> |
| </body> |
| </TestCase> |
| <TestCase testID="div_style_dividerAffordance_set_spark" keywords="[DividedBox,style,dividerAffordance,set]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitEvent="updateComplete" waitTarget="div"/> |
| <RunCode code="application.div.setStyle('verticalGap',30);" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <RunCode code="application.div.setStyle('dividerAffordance',25);" /> |
| <AssertMethodValue target="div" method="value=application.div.getStyle('dividerAffordance');" value="25" waitTarget="div" waitEvent="updateComplete"/> |
| <DispatchMouseEvent target="div" localX="250" localY="252" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="250" localY="252" type="mouseDown"/> |
| <WaitForEffectsToEnd /> |
| <AssertMethodValue method="value=getCursor()" value="0"/> |
| <DispatchMouseEvent target="div" localX="250" localY="252" type="mouseUp"/> |
| |
| <DispatchMouseEvent target="div" localX="250" localY="255" type="mouseMove"/> |
| <DispatchMouseEvent target="div" localX="250" localY="255" type="mouseDown"/> |
| <DispatchMouseEvent target="div" localX="250" localY="255" type="mouseUp" /> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="div_style_dividerThickness_default_spark" keywords="[DividedBox,style,dividerThickness, default]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <AssertMethodValue target="div" method="value=application.div.getStyle('dividerThickness');" value="3" /> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_default_spark.png" timeout="5000"/> |
| |
| </body> |
| </TestCase> |
| |
| <TestCase testID="div_style_dividerThickness_set_spark" keywords="[DividedBox,style,dividerThickness,set]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <RunCode code="application.div.setStyle('dividerThickness',10);" /> |
| <AssertMethodValue target="div" method="value=application.div.getStyle('dividerThickness');" value="10" waitTarget="div" waitEvent="updateComplete"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_dividerThickness_set_spark.png" timeout="5000"/> |
| </body> |
| </TestCase> |
| <TestCase testID="div_style_dividerColor_default_spark" keywords="[DividedBox,style,dividerColor, default]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <AssertMethodValue target="div" method="value=application.div.getStyle('dividerColor');" value="0x6F7777" /> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_default_spark.png" timeout="5000"/> |
| </body> |
| </TestCase> |
| <TestCase testID="div_style_dividerColor_string_spark" keywords="[DividedBox,style,dividerColor,string]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <RunCode code="application.div.setStyle('dividerColor','white');" /> |
| <AssertMethodValue target="div" method="value=application.div.getStyle('dividerColor');" value="0xffffff" waitTarget="div" waitEvent="updateComplete"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_dividerColor_string_spark.png" timeout="5000"/> |
| </body> |
| </TestCase> |
| <TestCase testID="div_style_dividerColor_123456_spark" keywords="[DividedBox,style,dividerColor,#]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <RunCode code="application.div.setStyle('dividerColor','#123456');" /> |
| <AssertMethodValue target="div" method="value=application.div.getStyle('dividerColor');" value="0x123456" waitTarget="div" waitEvent="updateComplete"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_dividerColor_hash_spark.png" timeout="5000"/> |
| </body> |
| </TestCase> |
| <TestCase testID="div_style_dividerColor_abcdef_spark" keywords="[DividedBox,style,dividerColor,0x]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <RunCode code="application.div.setStyle('dividerColor','0xabcdef');" /> |
| <AssertMethodValue target="div" method="value=application.div.getStyle('dividerColor');" value="0xabcdef" waitTarget="div" waitEvent="updateComplete"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_dividerColor_0x_spark.png" timeout="5000"/> |
| </body> |
| </TestCase> |
| <TestCase testID="div_style_dividerSkin_spark" keywords="[DividedBox,style,dividerSkin]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| <RunCode code="application.div.setStyle('verticalGap',30);" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <RunCode code="application.div.setStyle('dividerSkin', MySmallUpSkin)" waitTarget="div" waitEvent="updateComplete"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_dividerSkin_spark.png"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="div_style_dividerAlpha_spark" keywords="[DividedBox,style,dividerColor,0x]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| </setup> |
| <body> |
| <AssertMethodValue target="div" method="value=application.div.getStyle('dividerAlpha');" value="0.75" /> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_default_spark.png" timeout="5000"/> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| <RunCode code="application.div.setStyle('dividerAlpha','0.25');" /> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <WaitForEffectsToEnd /> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_DividerAlpha_small_spark.png" timeout="5000"/> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| <RunCode code="application.div.setStyle('dividerAlpha','0.95');" /> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_DividerAlpha_large_spark.png" timeout="5000"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="div_style_horizontalDividerCursor_spark" keywords="[DividedBox,style,horizontalDividerCursor ]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| <RunCode code="application.div.setStyle('horizontalGap',30);" /> |
| </setup> |
| <body> |
| <RunCode code="application.div.setStyle('horizontalDividerCursor', MyHCursor)" /> |
| <RunCode code="application.div.setStyle('dividerAffordance',25);" /> |
| <SetProperty target="div" propertyName="direction" value="horizontal" waitTarget="div" waitEvent="updateComplete"/> |
| <DispatchMouseEvent target="div" localX="256" localY="250" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="256" localY="250" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_horizontalDividerCursor_spark.png" timeout="5000"/> |
| </body> |
| </TestCase> |
| |
| |
| <TestCase testID="div_style_verticalDividerCursor_spark" keywords="[DividedBox,style,verticalDividerCursor ]"> |
| <setup> |
| <ResetComponent target="div" className="DivBoxComp_spark" waitTarget="div" waitEvent="updateComplete"/> |
| <RunCode code="application.div.setStyle('verticalGap',30);" /> |
| </setup> |
| <body> |
| |
| <RunCode code="application.div.setStyle('verticalDividerCursor', MyVCursor)" /> |
| <RunCode code="application.div.setStyle('dividerAffordance',25);" /> |
| <SetProperty target="div" propertyName="direction" value="vertical" waitTarget="div" waitEvent="updateComplete"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseMove" waitEvent="mouseMove" waitTarget="div"/> |
| <DispatchMouseEvent target="div" localX="250" localY="256" type="mouseDown" waitEvent="mouseDown" waitTarget="div"/> |
| <CompareBitmap target="div" url="../Styles/Baselines/divbox_verticalDividerCursor_spark.png" timeout="5000"/> |
| </body> |
| </TestCase> |
| |
| </testCases> |
| </UnitTester> |