blob: db2ce7d746f3f1fb6306d71a0443224a1c7c075b [file]
<?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="mx/effects/MaskEffect/Props/"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="*"
testSWF="../SWFs/MaskEffect_Main.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 -->
<testCases>
<TestCase testID="MaskEffect_scaleXTo_Default" keywords="[MaskEffect, Properties, scaleXTo]" description="Test the default value of the scaleXTo property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleXTo" value="NaN"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleXTo" keywords="[MaskEffect, Properties, scaleXTo]" description="Test the setting of the scaleXTo property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="scaleXTo" value=".5"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleXTo" value=".5"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleXTo_Play" keywords="[MaskEffect, Properties, scaleXTo]" description="Test the output look of the scaleXTo property.">
<setup>
<RunCode code="application.ResetImage()"/>
<RunCode code="application.ResetEffectScale(0, .7, 0, 1)"/>
</setup>
<body>
<RunCode code="application.testEffect.play()" waitTarget="testEffect" waitEvent="effectEnd"/>
<CompareBitmap target="testImage" url="../Props/Baselines/MaskEffect_scaleXTo_Play.png" />
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleEasingFunction_Default" keywords="[MaskEffect, Properties, scaleEasingFunction]" description="Test the default value of the scaleEasingFunction property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleEasingFunction" value="{null}"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleEasingFunction" keywords="[MaskEffect, Properties, scaleEasingFunction]" description="Test the setting of the scaleEasingFunction property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="scaleEasingFunction" value="{application.MyScaleEasing}"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleEasingFunction" value="{application.MyScaleEasing}"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_moveEasingFunction_Default" keywords="[MaskEffect, Properties, moveEasingFunction]" description="Test the default value of the moveEasingFunction property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="moveEasingFunction" value="{null}"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_moveEasingFunction" keywords="[MaskEffect, Properties, moveEasingFunction]" description="Test the setting of the moveEasingFunction property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="moveEasingFunction" value="{application.MyMoveEasing}"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="moveEasingFunction" value="{application.MyMoveEasing}"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_yTo_Default" keywords="[MaskEffect, Properties, yTo]" description="Test the default value of the yTo property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="yTo" value="NaN"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_yTo" keywords="[MaskEffect, Properties, yTo]" description="Test the setting of the yTo property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="yTo" value="50"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="yTo" value="50"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_yTo_Play" keywords="[MaskEffect, Properties, yTo]" description="Test the output look of the yTo property.">
<setup>
<RunCode code="application.ResetImage()"/>
<RunCode code="application.ResetEffectSize(0, 50, 0, 50)"/>
</setup>
<body>
<RunCode code="application.testEffect.play()" waitTarget="testEffect" waitEvent="effectEnd"/>
<CompareBitmap target="testImage" url="../Props/Baselines/MaskEffect_yTo_Play.png" />
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleYTo_Default" keywords="[MaskEffect, Properties, scaleYTo]" description="Test the default value of the scaleYTo property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleYTo" value="NaN"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleYTo" keywords="[MaskEffect, Properties, scaleYTo]" description="Test the setting of the scaleYTo property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="scaleYTo" value=".5"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleYTo" value=".5"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleYTo_Play" keywords="[MaskEffect, Properties, scaleYTo]" description="Test the output look of the scaleYTo property.">
<setup>
<RunCode code="application.ResetImage()"/>
<RunCode code="application.ResetEffectScale(0, 1, 0, .7)"/>
</setup>
<body>
<RunCode code="application.testEffect.play()" waitTarget="testEffect" waitEvent="effectEnd"/>
<CompareBitmap target="testImage" url="../Props/Baselines/MaskEffect_scaleYTo_Play.png" />
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleYFrom_Default" keywords="[MaskEffect, Properties, scaleYFrom]" description="Test the default value of the scaleYFrom property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleYFrom" value="NaN"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleYFrom" keywords="[MaskEffect, Properties, scaleYFrom]" description="Test the setting of the scaleYFrom property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="scaleYFrom" value=".5"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleYFrom" value=".5"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_xFrom_Default" keywords="[MaskEffect, Properties, xFrom]" description="Test the default value of the xFrom property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="xFrom" value="NaN"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_xFrom" keywords="[MaskEffect, Properties, xFrom]" description="Test the setting of the xFrom property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="xFrom" value="1"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="xFrom" value="1"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_xFrom_Play" keywords="[MaskEffect, Properties, xFrom]" description="Test the output look of the xFrom property.">
<setup>
<RunCode code="application.ResetImage()"/>
<RunCode code="application.ResetEffectSize(0, 0, 50, 50)"/>
</setup>
<body>
<RunCode code="application.testEffect.play()" waitTarget="testEffect" waitEvent="tweenUpdate"/>
<AssertPixelValue target="testImage" x="60" y="60" value="#3E48CC"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_createMaskFunction_Default" keywords="[MaskEffect, Properties, createMaskFunction]" description="Test the default value of the createMaskFunction property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="createMaskFunction" value="{null}"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_createMaskFunction" keywords="[MaskEffect, Properties, createMaskFunction]" description="Test the setting of the createMaskFunction property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="createMaskFunction" value="{application.MyMaskFunction}"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="createMaskFunction" value="{application.MyMaskFunction}"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_xTo_Default" keywords="[MaskEffect, Properties, xTo]" description="Test the default value of the xTo property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="xTo" value="NaN"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_xTo" keywords="[MaskEffect, Properties, xTo]" description="Test the setting of the xTo property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="xTo" value="50"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="xTo" value="50"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_xTo_Play" keywords="[MaskEffect, Properties, xTo]" description="Test the output look of the xTo property.">
<setup>
<RunCode code="application.ResetImage()"/>
<RunCode code="application.ResetEffectSize(0, 0, 50, 50)"/>
</setup>
<body>
<RunCode code="application.testEffect.play()" waitTarget="testEffect" waitEvent="effectEnd"/>
<CompareBitmap target="testImage" url="../Props/Baselines/MaskEffect_xTo_Play.png" />
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleXFrom_Default" keywords="[MaskEffect, Properties, scaleXFrom]" description="Test the default value of the scaleXFrom property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleXFrom" value="NaN"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_scaleXFrom" keywords="[MaskEffect, Properties, scaleXFrom]" description="Test the setting of the scaleXFrom property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="scaleXFrom" value=".5"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="scaleXFrom" value=".5"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_yFrom_Default" keywords="[MaskEffect, Properties, yFrom]" description="Test the default value of the yFrom property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="yFrom" value="NaN"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_yFrom" keywords="[MaskEffect, Properties, yFrom]" description="Test the setting of the yFrom property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="yFrom" value="1"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="yFrom" value="1"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_repeatCount_Default" keywords="[MaskEffect, Properties, repeatCount]" description="Test the default value of the repeatCount property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="repeatCount" value="1"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_repeatCount" keywords="[MaskEffect, Properties, repeatCount]" description="Test the setting of the repeatCount property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="repeatCount" value="5"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="repeatCount" value="5"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_repeatCount_Play" keywords="[MaskEffect, Properties, repeatCount]" description="Verify the effect is played 'repeatCount' times.">
<setup>
<RunCode code="application.ResetImage()"/>
<RunCode code="application.ResetEffectSize(50, 100, 50, 100)"/>
<SetProperty target="testEffect" propertyName="repeatCount" value="3"/>
</setup>
<body>
<RunCode code="application.testEffect.play()" waitTarget="testEffect" waitEvent="effectEnd"/>
<AssertPropertyValue propertyName="tweenCounter" value="3"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_suspendBackgroundProcessing_Default" keywords="[MaskEffect, Properties, suspendBackgroundProcessing]" description="Test the default value of the suspendBackgroundProcessing property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="suspendBackgroundProcessing" value="false"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_suspendBackgroundProcessing" keywords="[MaskEffect, Properties, suspendBackgroundProcessing]" description="Test the setting of the suspendBackgroundProcessing property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="suspendBackgroundProcessing" value="true"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="suspendBackgroundProcessing" value="true"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_instanceClass" keywords="[MaskEffect, Properties, instanceClass]" description="Test the setting of the instanceClass property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="instanceClass" value="{application.myMaskEffectInstance}"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="instanceClass" value="{application.myMaskEffectInstance}"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_startDelay_Default" keywords="[MaskEffect, Properties, startDelay]" description="Test the default value of the startDelay property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="startDelay" value="0"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_startDelay" keywords="[MaskEffect, Properties, startDelay]" description="Test the setting of the startDelay property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="startDelay" value="500"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="startDelay" value="500"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_startDelay_Play" keywords="[MaskEffect, Properties, startDelay]" description="Test the effect does not play during the startDelay.">
<setup>
<RunCode code="application.ResetEffectSize(50, 100, 50, 100)"/>
<SetProperty target="testEffect" propertyName="startDelay" value="1000"/>
<SetProperty target="testEffect" propertyName="duration" value="1000"/>
</setup>
<body>
<RunCode code="application.testEffect.play()" />
<Pause timeout="700"/>
<CompareBitmap target="testImage" url="../Props/Baselines/MaskEffect_startDelay_Play.png" />
</body>
</TestCase>
<TestCase testID="MaskEffect_repeatDelay_Default" keywords="[MaskEffect, Properties, repeatDelay]" description="Test the default value of the repeatDelay property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="repeatDelay" value="0"/>
</body>
</TestCase>
<TestCase testID="MaskEffect_repeatDelay" keywords="[MaskEffect, Properties, repeatDelay]" description="Test the setting of the repeatDelay property.">
<setup>
<RunCode code="application.ResetEffectDefault()"/>
<SetProperty target="testEffect" propertyName="repeatDelay" value="250"/>
</setup>
<body>
<AssertPropertyValue target="testEffect" propertyName="repeatDelay" value="250"/>
</body>
</TestCase>
</testCases>
</UnitTester>