blob: c936a68a3187dc4eac7ded9207d52846fe2646d5 [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 testDir="Application/Application_SparkSkin/Properties/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="ApplicationApp1.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[
import mx.core.*;
import flash.display.Stage;
public function measureScriptTimeLimit():int{
var theSeconds:int = -1;
var secondsPassed:int = -1;
var theDate:Date;
try{
while(true){
theDate = new Date();
if(theDate.seconds != theSeconds){
++secondsPassed;
theSeconds = theDate.seconds;
trace(secondsPassed);
}
// Be sure we don't run forever, in case scriptTimeLimit is broken.
if(secondsPassed > 10)
break;
}
}catch(e:Error){
// We should normally get an exception.
}
return secondsPassed;
}
]]>
</mx:Script>
<testCases>
<TestCase testID="property_application_test1" keywords="[application]"
description="Make sure we can get the application property (read-only).">
<body>
<AssertMethodValue method="value = (application.toString().indexOf('ApplicationApp1') != -1)" value="true" />
</body>
</TestCase>
<TestCase testID="property_controlBar_test1" keywords="[application, controlBar]"
description="Make sure we can get the applicationControlBar when there is an undocked one.">
<setup>
<ResetComponent target="acb1" className="mx.containers.ApplicationControlBar" waitEvent="updateComplete" />
</setup>
<body>
<AssertMethodValue method="value=application.controlBar" value="acb1" />
</body>
</TestCase>
<TestCase testID="property_controlBar_test2" keywords="[application, controlBar]"
description="Check controlBar when there is an undocked ApplicationControlBar.">
<setup>
<ResetComponent target="acb1" className="mx.containers.ApplicationControlBar" waitEvent="updateComplete" />
<SetProperty target="acb1" propertyName="dock" value="true" waitEvent="updateComplete" />
</setup>
<body>
<AssertMethodValue method="value=application.controlBar.id" value="acb1" />
</body>
</TestCase>
<TestCase testID="property_frameRate_test1" keywords="[application, frameRate]"
description="Be sure the stage gets the frameRate which was specified for the application.">
<body>
<AssertPropertyValue target="stage" propertyName="frameRate" value="136" />
</body>
</TestCase>
<TestCase testID="property_frameRate_test2" keywords="[application, frameRate]"
description="Be sure the application returns the frameRate specified.">
<body>
<AssertMethodValue method="value=FlexGlobals.topLevelApplication.frameRate" value="136" />
</body>
</TestCase>
<TestCase testID="property_scriptTimeLimit_test1" keywords="[application, scriptTimeLimit]"
description="Be sure the application returns the scriptTimeLimit.">
<body>
<AssertMethodValue method="value=FlexGlobals.topLevelApplication.scriptTimeLimit" value="5" />
</body>
</TestCase>
<TestCase testID="property_usePreloader_false" keywords="[application, usePreloader]"
description="Be sure usePreloader is false when set to false.">
<body>
<AssertMethodValue method="value=FlexGlobals.topLevelApplication.usePreloader" value="false" />
</body>
</TestCase>
<TestCase testID="property_viewSourceURL" keywords="[application, viewSourceURL]"
description="Be sure we can get the viewSourceURL when it has been set.">
<body>
<AssertMethodValue method="value=FlexGlobals.topLevelApplication.viewSourceURL" value="http://www.adobe.com" />
</body>
</TestCase>
</testCases>
</UnitTester>