summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/ajax/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /dom/tests/mochitest/ajax/lib
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--dom/tests/mochitest/ajax/lib/AJAX_setup.js35
-rw-r--r--dom/tests/mochitest/ajax/lib/test.css28
2 files changed, 63 insertions, 0 deletions
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);
diff --git a/dom/tests/mochitest/ajax/lib/test.css b/dom/tests/mochitest/ajax/lib/test.css
new file mode 100644
index 0000000000..38a401402f
--- /dev/null
+++ b/dom/tests/mochitest/ajax/lib/test.css
@@ -0,0 +1,28 @@
+.test_ok {
+ color: green;
+ display: none;
+}
+.test_not_ok {
+ color: red;
+ display: block;
+}
+
+.test_ok, .test_not_ok {
+ border-bottom-width: 2px;
+ border-bottom-style: solid;
+ border-bottom-color: black;
+}
+
+.all_pass {
+ background-color: lime;
+}
+
+.some_fail {
+ background-color: red;
+}
+
+.tests_report {
+ border-width: 2px;
+ border-style: solid;
+ width: 20em;
+}