blob: 0885f6aa8c24a0a933fa9b8b4ed253b0835e6f15 [file] [log] [blame]
<?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="MarshallPlan/Spark/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="MP_SparkControls_Main.mxml">
<mx:Script>
<![CDATA[
import mx.core.IFlexDisplayObject;
import mx.events.FlexEvent;
import flash.utils.*;
import mx.core.FlexSprite;
public static function init(o:DisplayObject):void
{
}
]]>
</mx:Script>
<mx:Metadata>
<![CDATA[
[Mixin]
]]>
</mx:Metadata>
<testCases>
<TestCase testID="MP_Spark_Component_toolTip_trusted" description="Test that you can see a tooltip for a Spark component." keywords="[TextInput, Spark, Marshall Plan, ToolTip]">
<setup>
<ResetComponent target="control1" className="spark.components.TextInput" waitTarget="control1"
waitEvent="updateComplete" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" />
<SetProperty target="swf1" propertyName="source" value="../../../Assets/Images/smallpurplerect.jpg" waitTarget="swf1" waitEvent="updateComplete"/>
<Pause timeout="100" />
<SetProperty target="swf1" propertyName="loadForCompatibility" value="false" />
<SetProperty target="swf1" propertyName="autoLoad" value="false" />
<SetProperty target="swf1" propertyName="source" value="assets/MP_SparkControls_Child.swf" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" waitTarget="swf1" waitEvent="complete"/>
</setup>
<body>
<DispatchMouseEvent target="" type="mouseMove" localX="12" localY="55" waitTarget="swf1.content" waitEvent="applicationComplete"/>
<DispatchMouseEvent type="mouseOver" target="swf1.content.document.textinput1" localX="20" localY="8"
waitEvent="toolTipShown" waitTarget="swf1.content.document.textinput1" />
<WaitForEffectsToEnd />
<Pause timeout="200" />
<CompareBitmap numColorVariances="4" maxColorVariance="10" url="../Spark/baselines/$testID_2.png" target="swf1.content.document.group1" timeout="2000" />
</body>
</TestCase>
<TestCase testID="MP_Spark_Component_toolTip_compatibility" description="Test that you can see a tooltip for a Spark component in compatibility mode." keywords="[TextInput, Spark, Marshall Plan, ToolTip]">
<setup>
<ResetComponent target="control1" className="spark.components.TextInput" waitTarget="control1"
waitEvent="updateComplete" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" />
<SetProperty target="swf1" propertyName="source" value="../../../Assets/Images/smallpurplerect.jpg" waitTarget="swf1" waitEvent="updateComplete"/>
<Pause timeout="100" />
<SetProperty target="swf1" propertyName="loadForCompatibility" value="true" />
<SetProperty target="swf1" propertyName="autoLoad" value="false" />
<SetProperty target="swf1" propertyName="source" value="assets/MP_SparkControls_Child.swf" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" waitTarget="swf1" waitEvent="complete"/>
</setup>
<body>
<DispatchMouseEvent target="" type="mouseMove" localX="12" localY="55" waitTarget="swf1.content" waitEvent="applicationComplete"/>
<DispatchMouseEvent type="mouseOver" target="swf1.content.document.textinput1" localX="20" localY="8"/>
<AssertEvent eventName="toolTipShown" eventClass="mx.events::ToolTipEvent" target="swf1.content.document.textinput1" />
</body>
</TestCase>
<TestCase testID="MP_Spark_Component_toolTip_untrusted" description="Test that you can see a tooltip for a Spark component in untrusted mode." keywords="[TextInput, Spark, Marshall Plan, ToolTip]">
<setup>
<ResetComponent target="control1" className="spark.components.TextInput" waitTarget="control1"
waitEvent="updateComplete" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" />
<SetProperty target="swf1" propertyName="source" value="../../../Assets/Images/smallpurplerect.jpg" waitTarget="swf1" waitEvent="updateComplete"/>
<Pause timeout="100" />
<SetProperty target="swf1" propertyName="autoLoad" value="false" />
<SetProperty target="swf1" propertyName="autoLoad" value="false" />
<SetProperty target="swf1" propertyName="source" value="http://localhost:{portNumber}/MarshallPlan/SWFs/assets/MP_SparkControls_Child.swf?77_40?77_40?77_40" waitTarget="swf1" waitEvent="updateComplete"/>
<SetProperty target="swf1" propertyName="autoLoad" value="true" waitTarget="swf1" waitEvent="complete"/>
</setup>
<body>
<DispatchMouseEvent target="" type="mouseMove" localX="12" localY="55" waitTarget="swf1.content" waitEvent="applicationComplete"/>
<DispatchMouseEvent type="mouseOver" target="swf1.content.document.textinput1" localX="20" localY="8"
waitEvent="toolTipShown" waitTarget="swf1.content.document.textinput1" />
<AssertEvent eventName="toolTipShown" eventClass="mx.events::ToolTipEvent" target="swf1.content.document.textinput1" />
</body>
</TestCase>
<TestCase testID="MP_Spark_Component_TextAreaScrolling_compatible" description="Test that you can use a ScrollBar on a spark TextArea." keywords="[TextArea, ScrollBar, Spark, Marshall Plan, ToolTip]">
<setup>
<ResetComponent target="control1" className="spark.components.TextInput" waitTarget="control1"
waitEvent="updateComplete" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" />
<SetProperty target="swf1" propertyName="source" value="../../../Assets/Images/smallpurplerect.jpg" waitTarget="swf1" waitEvent="updateComplete"/>
<Pause timeout="100" />
<SetProperty target="swf1" propertyName="loadForCompatibility" value="true" />
<SetProperty target="swf1" propertyName="autoLoad" value="false" />
<SetProperty target="swf1" propertyName="source" value="assets/MP_SparkControls_Child.swf" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" waitTarget="swf1" waitEvent="complete"/>
</setup>
<body>
<DispatchMouseEvent target="" type="mouseMove" localX="12" localY="55" waitTarget="swf1.content" waitEvent="applicationComplete"/>
<DispatchMouseEvent type="rollOver" target="swf1.content.document.textarea1.scroller.verticalScrollBar.track" localX="5" localY="30" />
<DispatchMouseEvent type="mouseDown" target="swf1.content.document.textarea1.scroller.verticalScrollBar.track" localX="5" localY="30" />
<WaitForEffectsToEnd />
<DispatchMouseEvent type="mouseUp" target="swf1.content.document.textarea1" localX="5" localY="30" waitEvent="change"
waitTarget="swf1.content.document.textarea1.scroller.verticalScrollBar" />
<WaitForEffectsToEnd />
<Pause timeout="200" />
<CompareBitmap url="../Spark/baselines/$testID.png" target="swf1.content.document.textarea1" timeout="2000" numColorVariances="8" ignoreMaxColorVariance="true" />
</body>
</TestCase>
<TestCase testID="MP_Spark_Component_TextAreaScrolling_untrusted" description="Test that you can use a ScrollBar on a spark TextArea." keywords="[TextArea, ScrollBar, Spark, Marshall Plan, ToolTip]">
<setup>
<ResetComponent target="control1" className="spark.components.TextInput" waitTarget="control1"
waitEvent="updateComplete" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" />
<SetProperty target="swf1" propertyName="source" value="../../../Assets/Images/smallpurplerect.jpg" waitTarget="swf1" waitEvent="updateComplete"/>
<Pause timeout="100" />
<SetProperty target="swf1" propertyName="autoLoad" value="false" />
<SetProperty target="swf1" propertyName="source" value="http://localhost:{portNumber}/MarshallPlan/SWFs/assets/MP_SparkControls_Child.swf?160_40?160_40?160_40" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" waitTarget="swf1" waitEvent="complete"/>
</setup>
<body>
<DispatchMouseEvent target="" type="mouseMove" localX="12" localY="55" waitTarget="swf1.content" waitEvent="applicationComplete"/>
<DispatchMouseEvent type="rollOver" target="swf1.content.document.textarea1.scroller.verticalScrollBar.track" localX="5" localY="30" />
<DispatchMouseEvent type="mouseDown" target="swf1.content.document.textarea1.scroller.verticalScrollBar.track" localX="5" localY="30" />
<WaitForEffectsToEnd />
<DispatchMouseEvent type="mouseUp" target="swf1.content.document.textarea1" localX="5" localY="30" />
<AssertEvent eventName="change" eventClass="flash.events::Event" target="swf1.content.document.textarea1.scroller.verticalScrollBar" />
</body>
</TestCase>
<!-- Note, we are taking a bitmap of the whole stage because we need to get a picture of the DropDownList plus the dropdown. The dropdown
should be beyond the swf borders and into its parent. This also covers bug SDK-29635
-->
<TestCase testID="MP_Spark_Component_DropDownList_compatible" description="Test that you can use a DropDownList in a trusted child." keywords="[DropDownList, Spark, Marshall Plan, ToolTip]">
<setup>
<ResetComponent target="control1" className="spark.components.TextInput" waitTarget="control1"
waitEvent="updateComplete" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" />
<SetProperty target="swf1" propertyName="source" value="../../../Assets/Images/smallpurplerect.jpg" waitTarget="swf1" waitEvent="updateComplete"/>
<Pause timeout="100" />
<SetProperty target="swf1" propertyName="loadForCompatibility" value="true" />
<SetProperty target="swf1" propertyName="autoLoad" value="false" />
<SetProperty target="swf1" propertyName="source" value="assets/MP_SparkControls_Child.swf" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" waitTarget="swf1" waitEvent="complete"/>
</setup>
<body>
<DispatchMouseEvent target="" type="mouseMove" localX="12" localY="55" waitTarget="swf1.content" waitEvent="applicationComplete"/>
<DispatchMouseEvent type="rollOver" target="swf1.content.document.comboBox1.skin" localX="5" localY="10" waitEvent="rollOver"
waitTarget="swf1.content.document.comboBox1"/>
<DispatchMouseEvent type="mouseDown" target="swf1.content.document.comboBox1.skin" localX="5" localY="10" waitEvent="open" waitTarget="swf1.content.document.comboBox1"/>
<WaitForEffectsToEnd />
<DispatchMouseEvent type="mouseUp" target="swf1.content.document.comboBox1.skin" localX="5" localY="10" />
<WaitForEffectsToEnd />
<CompareBitmap url="../Spark/baselines/$testID.png" target="" timeout="2000" numColorVariances="8" ignoreMaxColorVariance="true" />
<DispatchMouseClickEvent target="swf1.content.document.comboBox1.skin.popUp" localX="18" localY="38" />
</body>
</TestCase>
<!--TestCase testID="MP_Spark_Component_DropDownList_untrusted" description="Test that you can use a DropDownList in a untrusted child." keywords="[DropDownList, Spark, Marshall Plan, ToolTip]">
<setup>
<ResetComponent target="control1" className="spark.components.TextInput" waitTarget="control1"
waitEvent="updateComplete" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" />
<SetProperty target="swf1" propertyName="source" value="../../../Assets/Images/smallpurplerect.jpg" waitTarget="swf1" waitEvent="updateComplete"/>
<Pause timeout="100" />
<SetProperty target="swf1" propertyName="autoLoad" value="false" />
<SetProperty target="swf1" propertyName="source" value="http://localhost:{portNumber}/MarshallPlan/SWFs/assets/MP_SparkControls_Child.swf?227_40?227_40?227_40" />
<SetProperty target="swf1" propertyName="autoLoad" value="true" waitTarget="swf1" waitEvent="complete"/>
</setup>
<body>
<DispatchMouseEvent target="" type="mouseMove" localX="12" localY="55" waitTarget="swf1.content" waitEvent="applicationComplete"/>
<Pause timeout="1000" />
<DispatchMouseEvent type="rollOver" target="swf1.content.document.comboBox1.skin" localX="5" localY="10" waitEvent="rollOver"
waitTarget="swf1.content.document.comboBox1"/>
<DispatchMouseEvent type="mouseDown" target="swf1.content.document.comboBox1.skin" localX="5" localY="10" waitEvent="open" waitTarget="swf1.content.document.comboBox1"/>
<WaitForEffectsToEnd />
<DispatchMouseEvent type="mouseUp" target="swf1.content.document.comboBox1.skin" localX="5" localY="10" />
<WaitForEffectsToEnd />
<DispatchKeyEvent keys="[DOWN, DOWN, ENTER]" />
<AssertEvent eventName="change" eventClass="spark.events::IndexChangeEvent" target="swf1.content.document.comboBox1" />
</body>
</TestCase-->
</testCases>
</UnitTester>