blob: b7d83c116cac2d5150027b85f5a3b80f375d4071 [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:s="library://ns.adobe.com/flex/spark"
xmlns="*"
testDir="mobile/SkinnablePopupContainerSK/integration/"
testSWF="SkinnablePopUpContainerSKEffects.mxml">
<fx:Script><![CDATA[ public static function init(o:DisplayObject):void { } ]]></fx:Script>
<fx:Metadata><![CDATA[ [Mixin] ]]></fx:Metadata>
<fx:Script>
<![CDATA[
import views.*;
import mx.events.TouchInteractionReason;
import mx.events.TouchInteractionEvent;
import mx.core.InteractionMode;
import spark.components.Scroller;
import spark.layouts.VerticalLayout;
import spark.layouts.HorizontalLayout;
import mx.core.FlexGlobals;
import spark.components.DataGroup;
import mx.core.mx_internal;
use namespace mx_internal;
]]>
</fx:Script>
<testCases>
<TestCase testID="SPUC_skEffects_resizeforsoftkeyboard_default" keywords="[SPUC, SK, Callout]" description="verifies initial SK pops up and resizes the SPUC correctly">
<setup>
<RunCode code="application.stage.focus=null" />
<ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" timeout="6000" />
<WaitForLayoutManager />
</setup>
<body>
<RunCode code="application.navigator.pushView(views.SPUC_Resize)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000" />
<DispatchMouseClickEvent target="navigator.activeView.textInput" localX="20" localY="20" waitTarget="navigator.activeView.callout" waitEvent="open" timeout="6000"/>
<AssertPropertyValue target="navigator.activeView.callout" propertyName="resizeForSoftKeyboard" value="true" />
</body>
</TestCase>
<TestCase testID="SPUC_skEffects_moveforsoftkeyboard_default" keywords="[SPUC, SK, Callout]" description="verifies initial SK pops up and resizes the SPUC correctly">
<setup>
<RunCode code="application.stage.focus=null" />
<ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" timeout="6000" />
<WaitForLayoutManager />
</setup>
<body>
<RunCode code="application.navigator.pushView(views.SPUC_Resize)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000" />
<DispatchMouseClickEvent target="navigator.activeView.textInput" localX="20" localY="20" waitTarget="navigator.activeView.callout" waitEvent="open" timeout="6000"/>
<AssertPropertyValue target="navigator.activeView.callout" propertyName="moveForSoftKeyboard" value="true" />
</body>
</TestCase>
<TestCase testID="SPUC_skEffects_resizeforsoftkeyboard_setter" keywords="[SPUC, SK, Callout]" description="verifies initial SK pops up and resizes the SPUC correctly">
<setup>
<RunCode code="application.stage.focus=null" />
<ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" timeout="6000" />
<WaitForLayoutManager />
</setup>
<body>
<RunCode code="application.navigator.pushView(views.SPUC_Resize)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000" />
<DispatchMouseClickEvent target="navigator.activeView.textInput" localX="20" localY="20" waitTarget="navigator.activeView.callout" waitEvent="open" timeout="6000"/>
<SetProperty target="navigator.activeView.callout" propertyName="resizeForSoftKeyboard" value="false" />
<AssertPropertyValue target="navigator.activeView.callout" propertyName="resizeForSoftKeyboard" value="false" />
</body>
</TestCase>
<TestCase testID="SPUC_skEffects_moveforsoftkeyboard_setter" keywords="[SPUC, SK, Callout]" description="verifies initial SK pops up and resizes the SPUC correctly">
<setup>
<RunCode code="application.stage.focus=null" />
<ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" timeout="6000" />
<WaitForLayoutManager />
</setup>
<body>
<RunCode code="application.navigator.pushView(views.SPUC_Resize)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000" />
<DispatchMouseClickEvent target="navigator.activeView.textInput" localX="20" localY="20" waitTarget="navigator.activeView.callout" waitEvent="open" timeout="6000"/>
<SetProperty target="navigator.activeView.callout" propertyName="moveForSoftKeyboard" value="false" />
<AssertPropertyValue target="navigator.activeView.callout" propertyName="moveForSoftKeyboard" value="false" />
</body>
</TestCase>
<TestCase testID="SPUC_skEffects_initialresize" keywords="[SPUC, SK, Callout]" description="verifies initial SK pops up and resizes the SPUC correctly">
<setup>
<RunCode code="application.stage.focus=null" />
<ResetComponent target="navigator" className="comps.QANavigator" waitEvent="viewChangeComplete" timeout="6000" />
<WaitForLayoutManager />
</setup>
<body>
<RunCode code="application.navigator.pushView(views.SPUC_Resize)" waitTarget="navigator" waitEvent="viewChangeComplete" timeout="6000" />
<DispatchMouseClickEvent target="navigator.activeView.textInput" localX="20" localY="20" waitTarget="navigator.activeView.callout" waitEvent="open" timeout="6000"/>
<AssertMethodValue method="value =application.navigator.activeView.callout.isOpen == true" value="true"/>
<!-- Click on callout ti to activate sk -->
<DispatchMouseClickEvent target="navigator.activeView.callout_ti" localX="20" localY="20" waitTarget="navigator.activeView.callout_ti" waitEvent="softKeyboardActivate" timeout="6000"/>
<Pause timeout="1000" />
<AssertMethodValue method="value=application.softKeyboardRect.top&gt;0" value="true"/>
<AssertMethodValue method="value=(application.navigator.activeView.callout.height+application.navigator.activeView.callout.bottom)&lt;=application.softKeyboardRect.top" valueExpression="value=true"/>
</body>
</TestCase>
</testCases>
</UnitTester>