blob: 2cc4374c97be08b44c1f6a3520b9930667a1d720 [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="gumbo/components/ButtonBar/Methods/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="ButtonBarApp1.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 Assets.*;
import spark.events.ElementExistenceEvent;
import spark.components.DataGroup;
public var theDataGroup:DataGroup;
]]>
</mx:Script>
<testCases>
<!--
==============================================
partRemoved(partName:String, instance:Object)
==============================================
-->
<TestCase testID="partRemoved_test1" keywords="[ButtonBar,partRemoved]" description="Override partRemoved to dispatch a custom event. This also makes sure it is called when switching skins." >
<setup>
<ResetComponent target="bb3" className="Assets::CustomFxButtonBar2" waitEvent="updateComplete" />
<RunCode code="application.setDataProvider(application.bb3, 1)" waitEvent="updateComplete" waitTarget="skin" />
</setup>
<body>
<SetStyle target="bb3" styleName="skinClass" valueExpression="value=CustomSkinClass_FxRadioButtons" />
<AssertEvent target="bb3" eventName="customRemoveEvent" eventClass="flash.events::Event" numExpectedEvents="-1" />
</body>
</TestCase>
<TestCase testID="partRemoved_test2" keywords="[ButtonBar,partRemoved]" description="Be sure that the old dataGroup really has no event listeners after changing to a new skin." >
<setup>
<ResetComponent target="bb3" className="Assets::CustomFxButtonBar2" waitEvent="updateComplete" />
<RunCode code="application.setDataProvider(application.bb3, 1)" waitEvent="updateComplete" waitTarget="skin" />
</setup>
<body>
<RunCode code="theDataGroup = application.bb3.dataGroup" />
<SetStyle target="bb3" styleName="skinClass" valueExpression="value=CustomSkinClass_FxRadioButtons" waitEvent="updateComplete" />
<AssertMethodValue method="value = theDataGroup.hasEventListener(ElementExistenceEvent.ELEMENT_ADD)" value="false" />
</body>
</TestCase>
</testCases>
</UnitTester>