Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | var AJAXtests = []; |
michael@0 | 2 | |
michael@0 | 3 | function runAJAXTest() { |
michael@0 | 4 | if (AJAXtests.length == 0) { |
michael@0 | 5 | SimpleTest.finish(); |
michael@0 | 6 | return; |
michael@0 | 7 | } |
michael@0 | 8 | |
michael@0 | 9 | var test = AJAXtests.shift(); |
michael@0 | 10 | var testframe = document.getElementById("testframe"); |
michael@0 | 11 | testframe.src = test; |
michael@0 | 12 | } |
michael@0 | 13 | |
michael@0 | 14 | function onManifestLoad(manifest) { |
michael@0 | 15 | if (manifest.testcases) { |
michael@0 | 16 | AJAXtests = manifest.testcases; |
michael@0 | 17 | runAJAXTest(); |
michael@0 | 18 | } else { |
michael@0 | 19 | ok(false, "manifest check", "no manifest!?!"); |
michael@0 | 20 | SimpleTest.finish(); |
michael@0 | 21 | } |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | function fetchManifest() { |
michael@0 | 25 | var d = loadJSONDoc("manifest.json"); |
michael@0 | 26 | d.addBoth(onManifestLoad); |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 30 | addLoadEvent(fetchManifest); |