Bug 942276 - Improve test_asmjs2.html once caching is deterministic (r=me)

--HG--
extra : rebase_source : 36d1b607bda300f455d4086fe1bd8c7ca3834e77
This commit is contained in:
Luke Wagner 2013-11-29 14:58:56 -06:00
parent b10aaf2d3e
commit c4f69baa02
2 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=854209
<script>
var jsFuns = SpecialPowers.Cu.getJSTestingFunctions();
ok(jsFuns.isAsmJSCompilationAvailable());
ok(jsFuns.isAsmJSCompilationAvailable(), "asm.js compilation is available");
</script>
<script src="http://mochi.test:8888/tests/js/xpconnect/tests/mochitest/file_asmjs.js"></script>

View File

@ -30,7 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=929236
code += "var g42 = f();\n";
code += "ok(jsFuns.isAsmJSFunction(g42), 'g42 is an asm.js function')\n";
code += "ok(g42() === 42, 'g42 returns the correct result')\n";
code += "finishedEvalAsync();";
code += "finishedEvalAsync(f);";
ok(code.length > 10000);
function evalAsync(code) {
@ -41,13 +41,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=929236
}
var state = 0;
function finishedEvalAsync() {
function finishedEvalAsync(module) {
switch (state) {
case 0:
state++;
evalAsync(code);
break;
case 1:
ok(jsFuns.isAsmJSModuleLoadedFromCache(module), 'module loaded from cache');
SimpleTest.finish();
break;
default: