diff --git a/tests/tests/swfs/avm2/sandbox_type_remote/Test.as b/tests/tests/swfs/avm2/sandbox_type_remote/Test.as new file mode 100644 index 000000000..bf7b922e1 --- /dev/null +++ b/tests/tests/swfs/avm2/sandbox_type_remote/Test.as @@ -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)); + } + } +} diff --git a/tests/tests/swfs/avm2/sandbox_type_remote/TestNetwork.as b/tests/tests/swfs/avm2/sandbox_type_remote/TestNetwork.as new file mode 100644 index 000000000..5b17803cf --- /dev/null +++ b/tests/tests/swfs/avm2/sandbox_type_remote/TestNetwork.as @@ -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); + } + } +} diff --git a/tests/tests/swfs/avm2/sandbox_type_remote/TestNoNetwork.as b/tests/tests/swfs/avm2/sandbox_type_remote/TestNoNetwork.as new file mode 100644 index 000000000..fd2ee5b23 --- /dev/null +++ b/tests/tests/swfs/avm2/sandbox_type_remote/TestNoNetwork.as @@ -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); + } + } +} diff --git a/tests/tests/swfs/avm2/sandbox_type_remote/localhost/test-network.swf b/tests/tests/swfs/avm2/sandbox_type_remote/localhost/test-network.swf new file mode 100644 index 000000000..c52164511 Binary files /dev/null and b/tests/tests/swfs/avm2/sandbox_type_remote/localhost/test-network.swf differ diff --git a/tests/tests/swfs/avm2/sandbox_type_remote/localhost/test-no-network.swf b/tests/tests/swfs/avm2/sandbox_type_remote/localhost/test-no-network.swf new file mode 100644 index 000000000..50a884bd7 Binary files /dev/null and b/tests/tests/swfs/avm2/sandbox_type_remote/localhost/test-no-network.swf differ diff --git a/tests/tests/swfs/avm2/sandbox_type_remote/output.txt b/tests/tests/swfs/avm2/sandbox_type_remote/output.txt new file mode 100644 index 000000000..93850a909 --- /dev/null +++ b/tests/tests/swfs/avm2/sandbox_type_remote/output.txt @@ -0,0 +1,3 @@ +Current sandbox type: localWithNetwork +[Network] Current sandbox type: remote +[No network] Current sandbox type: remote diff --git a/tests/tests/swfs/avm2/sandbox_type_remote/test.swf b/tests/tests/swfs/avm2/sandbox_type_remote/test.swf new file mode 100644 index 000000000..642d48cdc Binary files /dev/null and b/tests/tests/swfs/avm2/sandbox_type_remote/test.swf differ diff --git a/tests/tests/swfs/avm2/sandbox_type_remote/test.toml b/tests/tests/swfs/avm2/sandbox_type_remote/test.toml new file mode 100644 index 000000000..568cadba5 --- /dev/null +++ b/tests/tests/swfs/avm2/sandbox_type_remote/test.toml @@ -0,0 +1 @@ +num_ticks = 2