From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- dom/tests/mochitest/ajax/lib/AJAX_setup.js | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 dom/tests/mochitest/ajax/lib/AJAX_setup.js (limited to 'dom/tests/mochitest/ajax/lib/AJAX_setup.js') diff --git a/dom/tests/mochitest/ajax/lib/AJAX_setup.js b/dom/tests/mochitest/ajax/lib/AJAX_setup.js new file mode 100644 index 0000000000..e94531db06 --- /dev/null +++ b/dom/tests/mochitest/ajax/lib/AJAX_setup.js @@ -0,0 +1,35 @@ +var AJAXtests = []; + +function runAJAXTest() { + if (AJAXtests.length == 0) { + SimpleTest.finish(); + return; + } + + var test = AJAXtests.shift(); + var testframe = document.getElementById("testframe"); + testframe.src = test; +} + +function onManifestLoad(manifest) { + if (manifest.testcases) { + AJAXtests = manifest.testcases; + runAJAXTest(); + } else { + ok(false, "manifest check", "no manifest!?!"); + SimpleTest.finish(); + } +} + +function fetchManifest() { + var d = loadJSONDoc("manifest.json"); + d.addBoth(onManifestLoad); +} + +// Double timeout duration. Since this test case takes longer than 300 seconds +// on B2G emulator. +// See bug 968783. +SimpleTest.requestLongerTimeout(2); + +SimpleTest.waitForExplicitFinish(); +addLoadEvent(fetchManifest); -- cgit v1.2.3