tests: Add test for SWZ parsing

This commit is contained in:
EmperorBale 2022-09-24 01:30:22 -07:00 committed by EmperorBale
parent d72ef587f2
commit bbeea8715c
6 changed files with 35 additions and 0 deletions

View File

@ -522,6 +522,7 @@ swf_tests! {
(as3_string_match, "avm2/string_match", 1),
(as3_string_replace, "avm2/string_replace", 1),
(as3_string_search, "avm2/string_search", 1),
(as3_swz, "avm2/swz", 10),
(as3_try_catch, "avm2/try_catch", 1),
(as3_try_catch_typed, "avm2/try_catch_typed", 1),
(as3_string_slice_substr_substring, "avm2/string_slice_substr_substring", 1),

View File

@ -0,0 +1,32 @@
package {
import flash.net.*;
import flash.display.Loader;
import flash.utils.ByteArray;
import flash.system.ApplicationDomain;
public class Test{
public function Test(s) {
var myURLReq: URLRequest = new URLRequest();
myURLReq.url = "framework_4.5.0.20967.swz";
myURLReq.digest = "9f67b1c289a5b5db7b32844af679e758541d101b46a7f75672258953804971ff";
var myURLLoader: URLLoader = new URLLoader();
myURLLoader.dataFormat = URLLoaderDataFormat.BINARY;
myURLLoader.addEventListener("complete", onC);
myURLLoader.load(myURLReq);
function onC(e) {
var someLoader: Loader = new Loader();
s.addChild(someLoader);
someLoader.loadBytes((ByteArray)(myURLLoader.data));
someLoader.contentLoaderInfo.addEventListener("init", init);
}
function init(e) {
var domain: ApplicationDomain = e.target.applicationDomain;
trace(domain.getDefinition("mx.core.ByteArrayAsset"));
trace(domain.getDefinition("mx.core.BitmapAsset"));
}
}
}
}

Binary file not shown.

View File

@ -0,0 +1,2 @@
[class ByteArrayAsset]
[class BitmapAsset]

Binary file not shown.

Binary file not shown.