Skip to content

Commit

Permalink
Tests can be run in AIR instead of Flash Player
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Aug 26, 2021
1 parent fb44f17 commit 1033e6d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
19 changes: 19 additions & 0 deletions test/source/TestFeathers-app.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/32.0">
<id>com.feathersui.TestFeathers</id>
<filename>TestFeathers</filename>
<name>TestFeathers</name>
<versionNumber>1.0.0</versionNumber>
<description>Test runner for Feathers UI controls for Starling</description>
<copyright>2021 Bowler Hat LLC</copyright>

<initialWindow>
<content>TestFeathers.swf</content>
<autoOrients>true</autoOrients>
<fullScreen>false</fullScreen>
<visible>true</visible>
<renderMode>direct</renderMode>
</initialWindow>

<supportedLanguages>en</supportedLanguages>
</application>
15 changes: 14 additions & 1 deletion test/source/TestFeathers.as
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ package
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.system.Capabilities;
import flash.system.fscommand;
import flash.utils.getDefinitionByName;

import org.flexunit.internals.TraceListener;
import org.flexunit.listeners.CIListener;
Expand Down Expand Up @@ -365,7 +367,18 @@ package

private function flexunit_testsCompleteHandler(event:flash.events.Event):void
{
fscommand("quit");
if(Capabilities.playerType == "Desktop")
{
var NativeApplication:Class = Class(getDefinitionByName("flash.desktop.NativeApplication"));
if(NativeApplication)
{
NativeApplication.nativeApplication.exit();
}
}
else
{
fscommand("quit");
}
}

}
Expand Down

0 comments on commit 1033e6d

Please sign in to comment.