-
-
Notifications
You must be signed in to change notification settings - Fork 805
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add avm2/sandbox_type_remote test
Verifies the sandbox type of SWFs loaded through network.
- Loading branch information
Showing
8 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package { | ||
import flash.display.MovieClip; | ||
import flash.display.Loader; | ||
import flash.system.Security; | ||
import flash.net.URLRequest; | ||
|
||
// Compile with network enabled | ||
public class Test extends MovieClip { | ||
public function Test() { | ||
trace("Current sandbox type: " + Security.sandboxType); | ||
|
||
var test:Test = this; | ||
test.loadSwf("http://localhost:8000/test-network.swf", function():void { | ||
test.loadSwf("http://localhost:8000/test-no-network.swf", function():void {}); | ||
}); | ||
} | ||
|
||
private function loadSwf(url:String, callback:Function):void { | ||
var loader:Loader = new Loader(); | ||
loader.contentLoaderInfo.addEventListener("complete", callback); | ||
loader.load(new URLRequest(url)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package { | ||
import flash.display.Sprite; | ||
import flash.system.Security; | ||
|
||
// Compile with network enabled as localhost/test-network.swf | ||
public class TestNetwork extends Sprite { | ||
public function TestNetwork() { | ||
trace("[Network] Current sandbox type: " + Security.sandboxType); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/tests/swfs/avm2/sandbox_type_remote/TestNoNetwork.as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package { | ||
import flash.display.Sprite; | ||
import flash.system.Security; | ||
|
||
// Compile with network disabled as localhost/test-no-network.swf | ||
public class TestNoNetwork extends Sprite { | ||
public function TestNoNetwork() { | ||
trace("[No network] Current sandbox type: " + Security.sandboxType); | ||
} | ||
} | ||
} |
Binary file added
BIN
+755 Bytes
tests/tests/swfs/avm2/sandbox_type_remote/localhost/test-network.swf
Binary file not shown.
Binary file added
BIN
+761 Bytes
tests/tests/swfs/avm2/sandbox_type_remote/localhost/test-no-network.swf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Current sandbox type: localWithNetwork | ||
[Network] Current sandbox type: remote | ||
[No network] Current sandbox type: remote |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
num_ticks = 2 |