From 24b0c8b01ed1fc8fa69128ba508faec118de4f17 Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Wed, 4 Sep 2024 12:12:12 +0200 Subject: [PATCH] tests: Add avm1/sandbox_type_remote test Verifies the sandbox type of SWFs loaded through network. --- .../localhost/test-network.swf | Bin 0 -> 126 bytes .../localhost/test-no-network.swf | Bin 0 -> 127 bytes .../swfs/avm1/sandbox_type_remote/output.txt | 3 +++ tests/tests/swfs/avm1/sandbox_type_remote/test.as | 10 ++++++++++ .../tests/swfs/avm1/sandbox_type_remote/test.swf | Bin 0 -> 334 bytes .../tests/swfs/avm1/sandbox_type_remote/test.toml | 1 + 6 files changed, 14 insertions(+) create mode 100644 tests/tests/swfs/avm1/sandbox_type_remote/localhost/test-network.swf create mode 100644 tests/tests/swfs/avm1/sandbox_type_remote/localhost/test-no-network.swf create mode 100644 tests/tests/swfs/avm1/sandbox_type_remote/output.txt create mode 100644 tests/tests/swfs/avm1/sandbox_type_remote/test.as create mode 100644 tests/tests/swfs/avm1/sandbox_type_remote/test.swf create mode 100644 tests/tests/swfs/avm1/sandbox_type_remote/test.toml diff --git a/tests/tests/swfs/avm1/sandbox_type_remote/localhost/test-network.swf b/tests/tests/swfs/avm1/sandbox_type_remote/localhost/test-network.swf new file mode 100644 index 0000000000000000000000000000000000000000..06fd856fb96827664c40871c3d87703d6fce353e GIT binary patch literal 126 zcmV-^0D=EQS5pUu0001ZoU349zresCUckU0!N}ku$jHFJ;LP;@|9^Yt7$CF5o`HoS zIxn@PJijPAR>8Tns3n_FC{6zLZPIxAk|8NA-J-*BsG_zI5oMnD6^!J0V*8= glx3L4#J~Y27-c{tlOKp=_H$QbZ~&SQ0HVPmdIWPhf&c&j literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm1/sandbox_type_remote/localhost/test-no-network.swf b/tests/tests/swfs/avm1/sandbox_type_remote/localhost/test-no-network.swf new file mode 100644 index 0000000000000000000000000000000000000000..acc9736fe218e697a0c954b37137810f0f7e609a GIT binary patch literal 127 zcmV-_0D%8PS5pUx0001ZoU349zresCUckU0!N}ku$N&V+O#lD?w`YzAGCQ0YSQw)7 z@)hz@OUm<$vSSsTON)w9^GXzo6Z2A%@+%ZdDhpDr6c~ali%U{-8H!VrON%l~DjA^C hAwXG%X-o_pV1iKwL^An-NM=8GH3kQu6#y02B7EvpGn)Va literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm1/sandbox_type_remote/output.txt b/tests/tests/swfs/avm1/sandbox_type_remote/output.txt new file mode 100644 index 000000000..24ea38eea --- /dev/null +++ b/tests/tests/swfs/avm1/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/avm1/sandbox_type_remote/test.as b/tests/tests/swfs/avm1/sandbox_type_remote/test.as new file mode 100644 index 000000000..25f8442e4 --- /dev/null +++ b/tests/tests/swfs/avm1/sandbox_type_remote/test.as @@ -0,0 +1,10 @@ +trace("Current sandbox type: " + System.security.sandboxType); + +var networkMc = _root.createEmptyMovieClip("network_mc", _root.getNextHighestDepth()); + +var loader = new MovieClipLoader(); +loader.onLoadInit = function(target, status) { + var noNetworkMc = _root.createEmptyMovieClip("no_network_mc", _root.getNextHighestDepth()); + noNetworkMc.loadMovie("http://localhost:8000/test-no-network.swf"); +} +loader.loadClip("http://localhost:8000/test-network.swf", networkMc); diff --git a/tests/tests/swfs/avm1/sandbox_type_remote/test.swf b/tests/tests/swfs/avm1/sandbox_type_remote/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..fb453f0afb03b94b95fb7f89042760e24f3d89af GIT binary patch literal 334 zcmV-U0kQr=S5pTo0ssJboPAJDPr^VHoGnH0TTbQRfs;3cqah}efKd{`qK4Sk=nh&e5Ud>;B3OCbnTP9wgg>u?%yMSY%7 z@TD2geE5=k#4l$Fr9<%&@?I1sh=e!c65qg0{ui-+4C0Uwi*aE|K$LV^tw{J@6bMC~ zvv#}PqRg)ui{?gnsuquCvswG^%%1_1X=R~m3Om--8tGaZU7hG|uga)o_cMaB5p21- zRy1M#BC77WZrjC?oo