blob: 0dc9efc4dc48f4cdefdeeb93c7cf01c7e28f759c [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="apollo/FileList/events/" xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" testSWF="FileList_main.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 flash.system.Capabilities;
import mx.controls.FileSystemList;
import flash.filesystem.File;
import mx.collections.ArrayCollection;
public var myAC:ArrayCollection = new ArrayCollection();
[Bindable]
public var myOS:String;
public var newDirectory:File;
private function whichOS():void
{
if (Capabilities.os.indexOf("Windows") != -1){
myOS="windows";
newDirectory = new File("c:\\windows");
}
else if (Capabilities.os.indexOf("Mac") != -1){
myOS="System";
newDirectory = new File("/System/");
}
}
private function setDir(): void
{
application.myFileSystemList.directory=newDirectory;
}
private function setVal(): void
{
application.myFileSystemList.directory=newDirectory;
application.myFileSystemList.extensions=[".txt"];
}
private function updateBackHis():String{
myAC.source = application.myFileSystemList.backHistory;
return String(myAC.source.length);
}
private function checkcurrentpath():String{
return String(application.myFileSystemList.directory.name);
}
]]>
</mx:Script>
<testCases>
<TestCase testID="FileSystemList_Event_directoryChange_afterInteraction" keywords="[canNavigateBack, FileSystemList]">
<setup>
<RunCode code="whichOS()"/>
<ResetComponent target="myFileSystemList" className="mx.controls::FileSystemList" waitEvent="updateComplete" waitTarget="myFileSystemList"/>
</setup>
<body>
<DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="myFileSystemList"/>
<DispatchMouseEvent type="mouseDown" localX="10" localY="10" target="myFileSystemList" />
<DispatchMouseEvent type="mouseUp" localX="10" localY="10" target="myFileSystemList"/>
<DispatchKeyEvent keys="[ENTER]" waitEvent="directoryChange" waitTarget="myFileSystemList"/>
<AssertEvent target="myFileSystemList" eventName="directoryChange" eventClass="mx.events::FileEvent" />
</body>
</TestCase>
<TestCase testID="FileSystemList_Event_directoryChange_afterCallingMethod" keywords="[canNavigateBack, FileSystemList]">
<setup>
<RunCode code="whichOS()"/>
<ResetComponent target="myFileSystemList" className="mx.controls::FileSystemList" waitEvent="updateComplete" waitTarget="myFileSystemList"/>
</setup>
<body>
<DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="myFileSystemList"/>
<DispatchMouseEvent type="mouseDown" localX="10" localY="10" target="myFileSystemList" />
<DispatchMouseEvent type="mouseUp" localX="10" localY="10" target="myFileSystemList"/>
<RunCode code="application.myFileSystemList.navigateDown()" waitEvent="directoryChange" waitTarget="myFileSystemList"/>
<AssertEvent target="myFileSystemList" eventName="directoryChange" eventClass="mx.events::FileEvent" />
</body>
</TestCase>
<!-- These tests have always been commented out since inception not sure why
<TestCase testID="FileSystemList_Event_directoryOpening_afterInteraction" keywords="[canNavigateBack, FileSystemList]">
<setup>
<ResetComponent target="myFileSystemList" className="mx.controls::FileSystemList" waitEvent="updateComplete" waitTarget="myFileSystemList"/>
</setup>
<body>
<DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="myFileSystemList"/>
<DispatchMouseEvent type="mouseDown" localX="10" localY="10" target="myFileSystemList" />
<DispatchMouseEvent type="mouseUp" localX="10" localY="10" target="myFileSystemList"/>
<DispatchKeyEvent keys="[ENTER]" waitEvent="directoryOpening" waitTarget="myFileSystemList"/>
<AssertEvent target="myFileSystemList" eventName="directoryOpening" eventClass="mx.events::FileEvent" />
</body>
</TestCase>
<TestCase testID="FileSystemList_Event_directoryOpening_afterCallingMethod" keywords="[canNavigateBack, FileSystemList]">
<setup>
<ResetComponent target="myFileSystemList" className="mx.controls::FileSystemList" waitEvent="updateComplete" waitTarget="myFileSystemList"/>
</setup>
<body>
<DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="myFileSystemList"/>
<DispatchMouseEvent type="mouseDown" localX="10" localY="10" target="myFileSystemList" />
<DispatchMouseEvent type="mouseUp" localX="10" localY="10" target="myFileSystemList"/>
<RunCode code="application.myFileSystemList.navigateDown()" waitEvent="directoryOpening" waitTarget="myFileSystemList"/>
<AssertEvent target="myFileSystemList" eventName="directoryOpening" eventClass="mx.events::FileEvent" />
</body>
</TestCase>
<TestCase testID="FileSystemList_Event_select_afterInteraction" keywords="[canNavigateBack, FileSystemList]">
<setup>
<ResetComponent target="myFileSystemList" className="mx.controls::FileSystemList" waitEvent="updateComplete" waitTarget="myFileSystemList"/>
</setup>
<body>
<DispatchKeyEvent keys="[TAB]" waitEvent="focusIn" waitTarget="myFileSystemList"/>
<DispatchMouseClickEvent localX="10" localY="10" target="myFileSystemList" waitEvent="select" waitTarget="myFileSystemList" />
<AssertEvent target="myFileSystemList" eventName="select" eventClass="mx.events::FileEvent" />
</body>
</TestCase>
-->
</testCases>
</UnitTester>