blob: de2c2450cb379e541fca8ecbcb108151fe5adc4c [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 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="*"
testDir="mobile/SplitViewNavigator/integration/"
testSWF="SplitViewNavigatorMain.mxml">
<fx:Script>
<![CDATA[
import mx.core.FlexGlobals;
import spark.components.ViewNavigator;
import flash.geom.Point;
import comps.*;
import spark.components.Callout;
import spark.layouts.*;
import views.*;
import skins.*;
import flash.ui.Keyboard;
public static function init(o:DisplayObject):void { };
]]>
</fx:Script>
<fx:Metadata><![CDATA[ [Mixin] ]]></fx:Metadata>
<testCases>
<TestCase testID="Back_key_test" keywords="[SplitViewNavigator, Back button]" description="Test Back key">
<setup>
<SetProperty target="svn2" propertyName="visible" value="false" />
<SetProperty target="svn3" propertyName="visible" value="false" />
<ResetComponent target="svn1" className="comps.MainTestComp" waitEvent="updateComplete" />
</setup>
<body>
<!--<DispatchKeyEvent type="keyUp" charCode="0" keyCode="0x01000016"/>-->
<RunCode code="FlexGlobals.topLevelApplication.dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP,true,false, 0, Keyboard.BACK))"/>
<WaitForEvent numExpectedEvents="1" eventName="viewChangeComplete" target="svn1.vn1" timeout="5000"/>
<AssertMethodValue method="value = FlexGlobals.topLevelApplication.svn1.vn1.activeView is View3" value="true" />
</body>
</TestCase>
<TestCase testID="Skin_test_1" keywords="[SplitViewNavigator, custom skin]" description="Apply custom skin to SplitViewNavigator">
<setup>
<SetProperty target="svn1" propertyName="visible" value="false" />
<SetProperty target="svn2" propertyName="visible" value="false" />
<ResetComponent target="svn3" className="comps.SkinTestComp" waitEvent="updateComplete" />
</setup>
<body>
<RunCode code="FlexGlobals.topLevelApplication.svn3.showFirstViewNavigatorInPopUp(FlexGlobals.topLevelApplication)" waitTarget="svn3.viewNavigatorPopUp" waitEvent="open"/>
<AssertPropertyValue target="svn3.viewNavigatorPopUp" propertyName="isOpen" value="true"/>
<!-- Without pause, callout isn't captured in ADL runs -->
<Pause timeout="200"/>
<CompareBitmap numColorVariances="20" maxColorVariance="16" url="../integration/baselines" target="svn3.viewNavigatorPopUp">
<ConditionalValue deviceDensity="160" os="win"/>
<ConditionalValue deviceDensity="240" os="android" />
<ConditionalValue deviceDensity="320" os="win"/>
<ConditionalValue deviceDensity="320" os="iphone" />
<ConditionalValue deviceDensity="160" os="qnx" />
</CompareBitmap>
</body>
</TestCase>
<TestCase testID="Change_skin_at_runtime" keywords="[SplitViewNavigator, custom skin]" description="Apply custom skin to SplitViewNavigator at runtime">
<setup>
<SetProperty target="svn1" propertyName="visible" value="false" />
<SetProperty target="svn2" propertyName="visible" value="false" />
<ResetComponent target="svn3" className="comps.SkinTestComp" waitEvent="updateComplete" />
</setup>
<body>
<RunCode code="FlexGlobals.topLevelApplication.svn3.setStyle('skinClass',skins.SVNSkin2)" />
<WaitForEvent numExpectedEvents="1" eventName="updateComplete" target="svn3" />
<RunCode code="FlexGlobals.topLevelApplication.svn3.showFirstViewNavigatorInPopUp(FlexGlobals.topLevelApplication.svn3)" waitTarget="svn3.viewNavigatorPopUp" waitEvent="open"/>
<AssertPropertyValue target="svn3.viewNavigatorPopUp" propertyName="isOpen" value="true"/>
<!-- Pause for QNX where the skinned callout failed to be captured.-->
<Pause timeout="200"/>
<CompareBitmap numColorVariances="20" maxColorVariance="16" url="../integration/baselines" target="svn3.viewNavigatorPopUp">
<ConditionalValue deviceDensity="160" os="win"/>
<ConditionalValue deviceDensity="240" os="android" />
<ConditionalValue deviceDensity="320" os="win"/>
<ConditionalValue deviceDensity="320" os="iphone" />
<ConditionalValue deviceDensity="160" os="qnx" />
</CompareBitmap>
</body>
</TestCase>
<TestCase testID="Callout_skin" keywords="[SplitViewNavigator, custom skin]" description="Apply custom skin that contains a custom Callout skin.">
<setup>
<SetProperty target="svn1" propertyName="visible" value="false" />
<SetProperty target="svn2" propertyName="visible" value="false" />
<ResetComponent target="svn3" className="comps.SkinTestComp" waitEvent="updateComplete" />
</setup>
<body>
<RunCode code="FlexGlobals.topLevelApplication.svn3.setStyle('skinClass',skins.SVNSkin3)" />
<WaitForEvent numExpectedEvents="1" eventName="updateComplete" target="svn3" />
<RunCode code="FlexGlobals.topLevelApplication.svn3.showFirstViewNavigatorInPopUp(FlexGlobals.topLevelApplication.svn3)" waitTarget="svn3.viewNavigatorPopUp" waitEvent="open" />
<AssertPropertyValue target="svn3.viewNavigatorPopUp" propertyName="isOpen" value="true"/>
<!-- Pause for QNX where the skinned callout failed to be captured.-->
<Pause timeout="200"/>
<CompareBitmap numColorVariances="260" ignoreMaxColorVariance="true" url="../integration/baselines" target="svn3.viewNavigatorPopUp">
<ConditionalValue deviceDensity="160" os="win"/>
<ConditionalValue deviceDensity="240" os="android" />
<ConditionalValue deviceDensity="320" os="win"/>
<ConditionalValue deviceDensity="320" os="iphone" />
<ConditionalValue deviceDensity="160" os="qnx" />
</CompareBitmap>
<RunCode code="FlexGlobals.topLevelApplication.svn3.hideViewNavigatorPopUp()" />
</body>
</TestCase>
<TestCase testID="Close_callout" keywords="[SplitViewNavigator, custom skin, callout]" description="Need to close callout. Otherwise it will linger with next tests. ">
<body>
<RunCode code="FlexGlobals.topLevelApplication.svn3.hideViewNavigatorPopUp()" />
<AssertPropertyValue target="svn3.viewNavigatorPopUp" propertyName="isOpen" value="false"/>
</body>
</TestCase>
</testCases>
</UnitTester>