mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 942276 - Improve test_asmjs2.html once caching is deterministic (r=me)
--HG-- extra : rebase_source : 36d1b607bda300f455d4086fe1bd8c7ca3834e77
This commit is contained in:
parent
aa87748fe0
commit
79dc058e8b
@ -17,7 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=854209
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
var jsFuns = SpecialPowers.Cu.getJSTestingFunctions();
|
var jsFuns = SpecialPowers.Cu.getJSTestingFunctions();
|
||||||
ok(jsFuns.isAsmJSCompilationAvailable());
|
ok(jsFuns.isAsmJSCompilationAvailable(), "asm.js compilation is available");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="http://mochi.test:8888/tests/js/xpconnect/tests/mochitest/file_asmjs.js"></script>
|
<script src="http://mochi.test:8888/tests/js/xpconnect/tests/mochitest/file_asmjs.js"></script>
|
||||||
|
@ -30,7 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=929236
|
|||||||
code += "var g42 = f();\n";
|
code += "var g42 = f();\n";
|
||||||
code += "ok(jsFuns.isAsmJSFunction(g42), 'g42 is an asm.js function')\n";
|
code += "ok(jsFuns.isAsmJSFunction(g42), 'g42 is an asm.js function')\n";
|
||||||
code += "ok(g42() === 42, 'g42 returns the correct result')\n";
|
code += "ok(g42() === 42, 'g42 returns the correct result')\n";
|
||||||
code += "finishedEvalAsync();";
|
code += "finishedEvalAsync(f);";
|
||||||
ok(code.length > 10000);
|
ok(code.length > 10000);
|
||||||
|
|
||||||
function evalAsync(code) {
|
function evalAsync(code) {
|
||||||
@ -41,13 +41,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=929236
|
|||||||
}
|
}
|
||||||
|
|
||||||
var state = 0;
|
var state = 0;
|
||||||
function finishedEvalAsync() {
|
function finishedEvalAsync(module) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case 0:
|
case 0:
|
||||||
state++;
|
state++;
|
||||||
evalAsync(code);
|
evalAsync(code);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
ok(jsFuns.isAsmJSModuleLoadedFromCache(module), 'module loaded from cache');
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user