| <?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="HScrollBar_method_default_smoothScrolling" keywords="[HScrollBar,method,smoothScrolling,step]" description="Checking Default smoothScrolling behavior to call animatePaging "> |
| <setup> |
| <ResetComponent target="hsb" className="spark.components.HScrollBar" waitEvent="updateComplete" /> |
| <SetStyle target="hsb" styleName="smoothScrolling" value="true" /> |
| </setup> |
| <body> |
| <RunCode code="application.hsb.changeValueByPage()" waitEvent="updateComplete" waitTarget="hsb"/> |
| <WaitForEffectsToEnd/> |
| <Pause timeout="100"/> |
| <AssertPropertyValue target="hsb" propertyName="minimum" value="0" /> |
| <AssertPropertyValue target="hsb" propertyName="maximum" value="100" /> |
| <AssertPropertyValue target="hsb" propertyName="pageSize" value="20" /> |
| <AssertPropertyValue target="hsb" propertyName="stepSize" value="1" /> |
| <AssertPropertyValue target="hsb" propertyName="value" value="20" /> |
| </body> |
| </TestCase> |
| <TestCase testID="HScrollBar_method_default_step" keywords="[HScrollBar,method,default,step]" description="Checking Default Values"> |
| <setup> |
| <ResetComponent target="hsb" className="spark.components.HScrollBar" waitEvent="updateComplete" /> |
| <SetStyle target="hsb" styleName="smoothScrolling" value="false" waitEvent="updateComplete" /> |
| |
| </setup> |
| <body> |
| <RunCode code="application.hsb.changeValueByStep()" waitEvent="valueCommit" waitTarget="hsb"/> |
| <AssertPropertyValue target="hsb" propertyName="minimum" value="0" /> |
| <AssertPropertyValue target="hsb" propertyName="maximum" value="100" /> |
| <AssertPropertyValue target="hsb" propertyName="pageSize" value="20" /> |
| <AssertPropertyValue target="hsb" propertyName="stepSize" value="1" /> |
| <AssertPropertyValue target="hsb" propertyName="value" value="1" /> |
| <CompareBitmap url="../methods/baselines/$testID.png" target="hsb" numColorVariances="5" maxColorVariance="1" /> |
| </body> |
| </TestCase> |
| <TestCase testID="HScrollBar_method_default_page" keywords="[HScrollBar,method,default,page]" description="Checking Default Values"> |
| <setup> |
| <ResetComponent target="hsb" className="spark.components.HScrollBar" waitEvent="updateComplete" /> |
| <SetStyle target="hsb" styleName="smoothScrolling" value="false" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="application.hsb.changeValueByPage()" waitEvent="updateComplete" waitTarget="hsb"/> |
| <WaitForEffectsToEnd/> |
| <Pause timeout="100"/> |
| <AssertPropertyValue target="hsb" propertyName="minimum" value="0" /> |
| <AssertPropertyValue target="hsb" propertyName="maximum" value="100" /> |
| <AssertPropertyValue target="hsb" propertyName="pageSize" value="20" /> |
| <AssertPropertyValue target="hsb" propertyName="stepSize" value="1" /> |
| <AssertPropertyValue target="hsb" propertyName="value" value="20" /> |
| <CompareBitmap url="../methods/baselines/$testID.png" target="hsb" numColorVariances="5" maxColorVariance="1" /> |
| </body> |
| </TestCase> |
| <TestCase testID="HScrollBar_method_step_back" keywords="[HScrollBar,method,default,step]" description="Checking Default Values"> |
| <setup> |
| <ResetComponent target="hsb" className="spark.components.HScrollBar" waitEvent="updateComplete" /> |
| <SetProperty target="hsb" propertyName="value" value="30" waitEvent="updateComplete" /> |
| <SetStyle target="hsb" styleName="smoothScrolling" value="false" waitEvent="updateComplete" /> |
| |
| </setup> |
| <body> |
| <RunCode code="application.hsb.changeValueByStep(false)" waitEvent="updateComplete" waitTarget="hsb"/> |
| <WaitForEffectsToEnd/> |
| <AssertPropertyValue target="hsb" propertyName="minimum" value="0" /> |
| <AssertPropertyValue target="hsb" propertyName="maximum" value="100" /> |
| <AssertPropertyValue target="hsb" propertyName="pageSize" value="20" /> |
| <AssertPropertyValue target="hsb" propertyName="stepSize" value="1" /> |
| <AssertPropertyValue target="hsb" propertyName="value" value="29" /> |
| </body> |
| </TestCase> |
| <TestCase testID="HScrollBar_method_default_page_back" keywords="[HScrollBar,method,default,page]" description="Checking Default Values"> |
| <setup> |
| <ResetComponent target="hsb" className="spark.components.HScrollBar" waitEvent="updateComplete" /> |
| <SetProperty target="hsb" propertyName="pageSize" value="20" /> |
| <SetProperty target="hsb" propertyName="value" value="80" waitEvent="updateComplete" /> |
| <SetStyle target="hsb" styleName="smoothScrolling" value="false" waitEvent="updateComplete" /> |
| </setup> |
| <body> |
| <RunCode code="application.hsb.changeValueByPage(false)" waitEvent="updateComplete" waitTarget="hsb"/> |
| <Pause timeout="100"/> |
| <WaitForEffectsToEnd/> |
| <AssertPropertyValue target="hsb" propertyName="minimum" value="0" /> |
| <AssertPropertyValue target="hsb" propertyName="maximum" value="100" /> |
| <AssertPropertyValue target="hsb" propertyName="pageSize" value="20" /> |
| <AssertPropertyValue target="hsb" propertyName="stepSize" value="1" /> |
| <AssertPropertyValue target="hsb" propertyName="value" value="60" /> |
| </body> |
| </TestCase> |
| </testCases> |
| |
| |
| </UnitTester> |