| <?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="components/TabBar/Styles/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="TabBar_Basic.mxml"> |
| |
| <!-- this set of lines form a template that must be in each unit test --> |
| <mx:Script> |
| <![CDATA[ |
| public static function init(o:DisplayObject):void |
| { |
| |
| } |
| |
| public function addData(bool:int):void |
| { |
| application.tb.dataProvider = myDP; |
| } |
| |
| public function addObjData():void |
| { |
| application.tb.dataProvider = iconDP; |
| } |
| |
| public function changeDP(node:int, bool:String):void |
| { |
| myDP.node[node].@enabled = bool; |
| } |
| |
| [Bindable] |
| public var iconDP:Array= [{label:"Toys", icon:"dino"},{label:"Dinosaur", icon: "dino"}]; |
| |
| ]]> |
| </mx:Script> |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| <!-- end of set of lines that must be in each unit test --> |
| <mx:Script> |
| <![CDATA[ |
| import mx.controls.TabBar; |
| import mx.styles.StyleManager; |
| import mx.managers.SystemManager; |
| import mx.events.ListEvent; |
| [Bindable] |
| private var myDP:Array=[{label:"Italy", data:"ITALY"},{label:"England", data:"ENGLAND"},{label:"Slovenia", data:"SLOVENIA"}]; |
| ]]> |
| </mx:Script> |
| |
| <mx:Style> |
| @namespace "library://ns.adobe.com/flex/mx"; |
| |
| |
| .tabStyle2 |
| { |
| fontWeight: bold; |
| } |
| |
| .tabStyle3 |
| { |
| fontSize: 24; |
| } |
| </mx:Style> |
| |
| <testCases> |
| |
| <TestCase testID="TabBar_Style_multiple_tabStyleName" description="TabBar using multiple styleName." keywords="[TabBar, tabStyleName]"> |
| <setup> |
| <ResetComponent target="tb" className="mx.controls.TabBar" waitEvent="updateComplete" waitTarget="tb" /> |
| <RunCode code="addData(0);" waitEvent="updateComplete" waitTarget="tb"/> |
| </setup> |
| <body> |
| <SetStyle target="tb" styleName="tabStyleName" value="tabStyle2 tabStyle3" waitEvent="updateComplete" waitTarget="tb"/> |
| <CompareBitmap target="tb" url="../styles/baselines/tabStyleName_multiple.png" timeout="5000" numColorVariances="4" ignoreMaxColorVariance="true"/> |
| </body> |
| </TestCase> |
| <TestCase testID="TabBar_Style_multiple_tabStyleName_precedence" description="TabBar using multiple styleName." keywords="[TabBar, tabStyleName]"> |
| <setup> |
| <ResetComponent target="tb" className="mx.controls.TabBar" waitEvent="updateComplete" waitTarget="tb" /> |
| <RunCode code="addData(0);" waitEvent="updateComplete" waitTarget="tb"/> |
| </setup> |
| <body> |
| <SetStyle target="tb" styleName="tabStyleName" value="tabStyle2 tabStyle3" waitEvent="updateComplete" waitTarget="tb"/> |
| <CompareBitmap target="tb" url="../styles/baselines/tabStyleName_multiple_precedence.png" timeout="5000" numColorVariances="4" ignoreMaxColorVariance="true"/> |
| </body> |
| </TestCase> |
| <TestCase testID="TabBar_Style_multiple_firstTabStyleName" description="TabBar using multiple firstTabStyleName." keywords="[TabBar, tabStyleName]"> |
| <setup> |
| <ResetComponent target="tb" className="mx.controls.TabBar" waitEvent="updateComplete" waitTarget="tb" /> |
| <RunCode code="addData(0);" waitEvent="updateComplete" waitTarget="tb"/> |
| </setup> |
| <body> |
| <SetStyle target="tb" styleName="firstTabStyleName" value="tabStyle2 tabStyle3" waitEvent="updateComplete" waitTarget="tb"/> |
| <CompareBitmap target="tb" url="../styles/baselines/firstTabStyleName_multiple.png" timeout="5000" numColorVariances="4" ignoreMaxColorVariance="true"/> |
| </body> |
| </TestCase> |
| <TestCase testID="TabBar_Style_multiple_firstTabStyleName_precedence" description="TabBar using multiple firstTabStyleName." keywords="[TabBar, tabStyleName]"> |
| <setup> |
| <ResetComponent target="tb" className="mx.controls.TabBar" waitEvent="updateComplete" waitTarget="tb" /> |
| <RunCode code="addData(0);" waitEvent="updateComplete" waitTarget="tb"/> |
| </setup> |
| <body> |
| <SetStyle target="tb" styleName="firstTabStyleName" value="tabStyle2 tabStyle3" waitEvent="updateComplete" waitTarget="tb"/> |
| <CompareBitmap target="tb" url="../styles/baselines/firstTabStyleName_multiple_precedence.png" timeout="5000" numColorVariances="4" ignoreMaxColorVariance="true"/> |
| </body> |
| </TestCase> |
| <TestCase testID="TabBar_Style_multiple_lastTabStyleName" description="TabBar using multiple lastTabStyleName." keywords="[TabBar, tabStyleName]"> |
| <setup> |
| <ResetComponent target="tb" className="mx.controls.TabBar" waitEvent="updateComplete" waitTarget="tb" /> |
| <RunCode code="addData(0);" waitEvent="updateComplete" waitTarget="tb"/> |
| </setup> |
| <body> |
| <SetStyle target="tb" styleName="lastTabStyleName" value="tabStyle2 tabStyle3" waitEvent="updateComplete" waitTarget="tb"/> |
| <CompareBitmap target="tb" url="../styles/baselines/lastTabStyleName_multiple.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| <TestCase testID="TabBar_Style_multiple_lastTabStyleName_precedence" description="TabBar using multiple lastTabStyleName." keywords="[TabBar, tabStyleName]"> |
| <setup> |
| <ResetComponent target="tb" className="mx.controls.TabBar" waitEvent="updateComplete" waitTarget="tb" /> |
| <RunCode code="addData(0);" waitEvent="updateComplete" waitTarget="tb"/> |
| </setup> |
| <body> |
| <SetStyle target="tb" styleName="lastTabStyleName" value="tabStyle2 tabStyle3" waitEvent="updateComplete" waitTarget="tb"/> |
| <CompareBitmap target="tb" url="../styles/baselines/lastTabStyleName_multiple_precedence.png" timeout="5000" /> |
| </body> |
| </TestCase> |
| </testCases> |
| |
| </UnitTester> |