| <?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="apollo/Window/Styles/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="Window_main_Spark.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 |
| { |
| } |
| ]]> |
| </mx:Script> |
| <mx:Metadata> |
| <![CDATA[ |
| [Mixin] |
| ]]> |
| </mx:Metadata> |
| <!-- end of set of lines that must be in each unit test --> |
| |
| <mx:Script> |
| <![CDATA[ |
| |
| [Bindable] |
| [Embed(source="../../../../Assets/Images/smallredrect.jpg")] |
| public var kb:Class; |
| |
| [Bindable] |
| [Embed(source="../../../../Assets/Images/redrect.jpg")] |
| public var buttonStyle:Class; |
| |
| ]]> |
| </mx:Script> |
| |
| <mx:Style> |
| .myStyle{ |
| color: red; |
| fontSize: 14; |
| fontWeight: bold; |
| } |
| |
| </mx:Style> |
| |
| <testCases> |
| <TestCase testID="Window_styles_buttonAlignment_auto_Spark" keywords="[Window, buttonAlignment, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <AssertStyleValue styleName="buttonAlignment" target="aw" value="auto"/> |
| <CompareBitmap target="aw" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_buttonAlignment_left_Spark" keywords="[Window, buttonAlignment, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" value="left" styleName="buttonAlignment"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_buttonAlignment_right_Spark" keywords="[Window, buttonAlignment, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" value="right" styleName="buttonAlignment"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_closeButtonStyleName_Spark" keywords="[Window, closeButtonStyleName, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" styleName="closeButtonSkin" value="{buttonStyle}"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_minimizeButtonStyleName_Spark" keywords="[Window, minimizeButtonStyleName, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" styleName="minimizeButtonSkin" value="{buttonStyle}"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_maximizeButtonStyleName_Spark" keywords="[Window, maximizeButtonStyleName, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" styleName="maximizeButtonSkin" value="{buttonStyle}"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_restoreButtonStyleName_Spark" keywords="[Window, restoreButtonStyleName, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" styleName="restoreButtonSkin" value="{buttonStyle}"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| <DispatchMouseClickEvent target="aw.titleBar.maximizeButton" localX="5" localY="5" waitEvent="updateComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar.maximizeButton" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_headerHeight_large_Spark" keywords="[Window, Style, headerHeight]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" styleName="headerHeight" value="30"/> |
| <SetProperty target="aw" propertyName="title" value="Header height 30"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw" /> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_headerHeight_small_Spark" keywords="[Window, Style, headerHeight]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" styleName="headerHeight" value="0.5"/> |
| <SetProperty target="aw" propertyName="title" value="Header height 0.5"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_showFlexChrome_default" keywords="[Window, styles, showFlexChrome]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <AssertStyleValue styleName="showFlexChrome" value="true" target="aw"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_showFlexChrome_false" keywords="[Window, styles, showFlexChrome]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle styleName="showFlexChrome" value="false" target="aw"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap url="../Styles/baselines/Window_styles_showFlexChrome_false_Spark.png" target="aw"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_statusBackgroundSkin_Spark" keywords="[Window, styles, statusBarBackgroundSkin]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| <SetStyle target="aw" styleName="statusBarBackgroundSkin" value="{kb}" waitEvent="updateComplete" waitTarget="aw" /> |
| </setup> |
| <body> |
| <CompareBitmap target="aw" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_statusBarBackgroundColor_Spark" keywords="[Window, styles, statusBackgroundColor]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" styleName="statusBarBackgroundColor" value="red" /> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_statusTextStyleName_Spark" keywords="[Window, styles, statusTextStyleName]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetStyle target="aw" styleName="statusTextStyleName" value="myStyle"/> |
| <SetProperty target="aw" propertyName="status" value="Status bar text"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_titleAlignment_default" keywords="[Window, titleAlignment, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| <DispatchMouseClickEvent target="aw.titleBar.maximizeButton" localX="5" localY="5" waitEvent="updateComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <AssertStyleValue styleName="titleAlignment" value="auto" target="aw"/> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_titleAlignment_left_Spark" keywords="[Window, titleAlignment, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty propertyName="title" value="Left title alignment" target="aw"/> |
| <SetProperty propertyName="width" value="600" target="aw"/> |
| <SetProperty propertyName="height" value="500" target="aw"/> |
| <SetStyle styleName="titleAlignment" value="left" target="aw"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_titleAlignment_center_Spark" keywords="[Window, titleAlignment, styles]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty propertyName="title" value="Center title alignment" target="aw"/> |
| <SetProperty propertyName="width" value="600" target="aw"/> |
| <SetProperty propertyName="height" value="500" target="aw"/> |
| <SetStyle styleName="titleAlignment" value="center" target="aw"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_titleBarBackgroundSkin_Spark" keywords="[Window, styles, titleBarBackgroundSkin]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetProperty propertyName="title" value="Center title alignment" target="aw"/> |
| <SetStyle styleName="titleBarBackgroundSkin" valueExpression="value=kb" target="aw"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_titleBarColors_Spark" keywords="[Window, styles, titleBarBackgroundColors]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetProperty propertyName="title" value="Colors" target="aw"/> |
| <SetStyle styleName="titleBarColors" value="[red,green]" target="aw"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| |
| <TestCase testID="Window_styles_titleTextStyleName_Spark" keywords="[Window, styles, titleBarBackgroundColors]"> |
| <setup> |
| <RunCode code="application.resetWindow()"/> |
| <SetProperty target="aw" value="300" propertyName="height"/> |
| <SetProperty target="aw" value="300" propertyName="width"/> |
| <SetProperty propertyName="title" value="Title style" target="aw"/> |
| <SetStyle styleName="titleTextStyleName" value="myStyle" target="aw"/> |
| <RunCode code="application.aw.open()" waitEvent="windowComplete" waitTarget="aw"/> |
| </setup> |
| <body> |
| <CompareBitmap target="aw.titleBar" url="../Styles/baselines/" > |
| <ConditionalValue os="win" /> |
| </CompareBitmap> |
| </body> |
| </TestCase> |
| </testCases> |
| </UnitTester> |