| <?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="gumbo/components/ScrollBar/methods/" 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:m="http://ns.adobe.com/mxml/2009" xmlns="*" testSWF="ScrollBar_main.mxml"> |
| |
| <!-- this set of lines form a template that must be in each unit test --> |
| |
| <fx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void |
| { |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </fx:Metadata> |
| <!-- end of set of lines that must be in each unit test --> |
| <fx:Script> |
| <![CDATA[ |
| |
| |
| |
| ]]> |
| </fx:Script> |
| <testCases> |
| <TestCase testID="VScrollBar_method_default_step" keywords="[VScrollBar,method,default,step]" description="Checking Default Values"> |
| <setup> |
| <ResetComponent target="vsb" className="spark.components.VScrollBar" waitEvent="updateComplete" /> |
| <SetProperty target="vsb" propertyName="minimum" value="-100" waitEvent="updateComplete"/> |
| <SetProperty target="vsb" propertyName="maximum" value="50" waitEvent="updateComplete"/> |
| <SetStyle target="vsb" styleName="smoothScrolling" value="false" waitEvent="updateComplete" /> |
| |
| </setup> |
| <body> |
| <RunCode code="application.vsb.changeValueByStep()" waitEvent="valueCommit" waitTarget="vsb"/> |
| <RunCode code="application.vsb.changeValueByStep()" waitEvent="valueCommit" waitTarget="vsb"/> |
| <RunCode code="application.vsb.changeValueByStep()" waitEvent="valueCommit" waitTarget="vsb"/> |
| <RunCode code="application.vsb.changeValueByStep()" waitEvent="valueCommit" waitTarget="vsb"/> |
| <AssertPropertyValue target="vsb" propertyName="minimum" value="-100" /> |
| <AssertPropertyValue target="vsb" propertyName="maximum" value="50" /> |
| <AssertPropertyValue target="vsb" propertyName="pageSize" value="20" /> |
| <AssertPropertyValue target="vsb" propertyName="stepSize" value="1" /> |
| <AssertPropertyValue target="vsb" propertyName="value" value="4" /> |
| </body> |
| </TestCase> |
| <TestCase testID="VScrollBar_method_default_page" keywords="[VScrollBar,method,default,page]" description="Checking Default Values"> |
| <setup> |
| <ResetComponent target="vsb" className="spark.components.VScrollBar" waitEvent="updateComplete" /> |
| <SetProperty target="vsb" propertyName="minimum" value="-100" waitEvent="updateComplete"/> |
| <SetProperty target="vsb" propertyName="maximum" value="-50" waitEvent="updateComplete"/> |
| <SetProperty target="vsb" propertyName="pageSize" value="5" /> |
| <SetProperty target="vsb" propertyName="value" value="-50" waitEvent="updateComplete"/> |
| <SetStyle target="vsb" styleName="smoothScrolling" value="false" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="application.vsb.changeValueByPage(false)" waitEvent="updateComplete" waitTarget="vsb"/> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="vsb" propertyName="minimum" value="-100" /> |
| <AssertPropertyValue target="vsb" propertyName="maximum" value="-50" /> |
| <AssertPropertyValue target="vsb" propertyName="pageSize" value="5" /> |
| <AssertPropertyValue target="vsb" propertyName="stepSize" value="1" /> |
| <AssertPropertyValue target="vsb" propertyName="value" value="-55" /> |
| </body> |
| </TestCase> |
| <TestCase testID="VScrollBar_method_step_back" keywords="[VScrollBar,method,default,step]" description="Checking Default Values"> |
| <setup> |
| <ResetComponent target="vsb" className="spark.components.VScrollBar" waitEvent="updateComplete" /> |
| <SetProperty target="vsb" propertyName="minimum" value="-100" waitEvent="updateComplete"/> |
| <SetProperty target="vsb" propertyName="maximum" value="0" waitEvent="updateComplete"/> |
| <SetProperty target="vsb" propertyName="stepSize" value="-20" /> |
| <SetProperty target="vsb" propertyName="snapInterval" value="1" /> |
| <SetProperty target="vsb" propertyName="value" value="-50" waitEvent="updateComplete"/> |
| <SetStyle target="vsb" styleName="smoothScrolling" value="false" waitEvent="updateComplete" /> |
| |
| </setup> |
| <body> |
| <RunCode code="application.vsb.changeValueByStep(false)" waitEvent="valueCommit" waitTarget="vsb"/> |
| <RunCode code="application.vsb.changeValueByStep(false)" waitEvent="valueCommit" waitTarget="vsb"/> |
| <AssertPropertyValue target="vsb" propertyName="minimum" value="-100" /> |
| <AssertPropertyValue target="vsb" propertyName="maximum" value="0" /> |
| <AssertPropertyValue target="vsb" propertyName="pageSize" value="20" /> |
| <AssertPropertyValue target="vsb" propertyName="stepSize" value="-20" /> |
| <AssertPropertyValue target="vsb" propertyName="value" value="-10" /> |
| </body> |
| </TestCase> |
| <TestCase testID="VScrollBar_method_default_page_back" keywords="[VScrollBar,method,default,page]" description="Checking Default Values"> |
| <setup> |
| <ResetComponent target="vsb" className="spark.components.VScrollBar" waitEvent="updateComplete" /> |
| <SetProperty target="vsb" propertyName="value" value="60" waitEvent="updateComplete" /> |
| <SetStyle target="vsb" styleName="smoothScrolling" value="false" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="application.vsb.changeValueByPage(false)" waitEvent="updateComplete" waitTarget="vsb"/> |
| <Pause timeout="100" /> |
| <AssertPropertyValue target="vsb" propertyName="minimum" value="0" /> |
| <AssertPropertyValue target="vsb" propertyName="maximum" value="100" /> |
| <AssertPropertyValue target="vsb" propertyName="pageSize" value="20" /> |
| <AssertPropertyValue target="vsb" propertyName="stepSize" value="1" /> |
| <AssertPropertyValue target="vsb" propertyName="value" value="40" /> |
| </body> |
| </TestCase> |
| </testCases> |
| |
| |
| </UnitTester> |