From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../storageevent/frameLocalStorageMaster.html | 63 ++++++++++ .../storageevent/frameLocalStorageSlaveEqual.html | 55 +++++++++ .../frameLocalStorageSlaveNotEqual.html | 39 +++++++ .../frameSessionStorageMasterEqual.html | 67 +++++++++++ .../frameSessionStorageMasterNotEqual.html | 70 +++++++++++ .../frameSessionStorageSlaveEqual.html | 59 ++++++++++ .../frameSessionStorageSlaveNotEqual.html | 39 +++++++ .../mochitest/storageevent/interOriginFrame.js | 63 ++++++++++ .../mochitest/storageevent/interOriginTest2.js | 60 ++++++++++ dom/tests/mochitest/storageevent/mochitest.toml | 38 ++++++ ...storageLocalStorageEventCheckNoPropagation.html | 43 +++++++ ...t_storageLocalStorageEventCheckPropagation.html | 43 +++++++ .../storageevent/test_storageNotifications.html | 130 +++++++++++++++++++++ ...orageSessionStorageEventCheckNoPropagation.html | 43 +++++++ ...storageSessionStorageEventCheckPropagation.html | 43 +++++++ 15 files changed, 855 insertions(+) create mode 100644 dom/tests/mochitest/storageevent/frameLocalStorageMaster.html create mode 100644 dom/tests/mochitest/storageevent/frameLocalStorageSlaveEqual.html create mode 100644 dom/tests/mochitest/storageevent/frameLocalStorageSlaveNotEqual.html create mode 100644 dom/tests/mochitest/storageevent/frameSessionStorageMasterEqual.html create mode 100644 dom/tests/mochitest/storageevent/frameSessionStorageMasterNotEqual.html create mode 100644 dom/tests/mochitest/storageevent/frameSessionStorageSlaveEqual.html create mode 100644 dom/tests/mochitest/storageevent/frameSessionStorageSlaveNotEqual.html create mode 100644 dom/tests/mochitest/storageevent/interOriginFrame.js create mode 100644 dom/tests/mochitest/storageevent/interOriginTest2.js create mode 100644 dom/tests/mochitest/storageevent/mochitest.toml create mode 100644 dom/tests/mochitest/storageevent/test_storageLocalStorageEventCheckNoPropagation.html create mode 100644 dom/tests/mochitest/storageevent/test_storageLocalStorageEventCheckPropagation.html create mode 100644 dom/tests/mochitest/storageevent/test_storageNotifications.html create mode 100644 dom/tests/mochitest/storageevent/test_storageSessionStorageEventCheckNoPropagation.html create mode 100644 dom/tests/mochitest/storageevent/test_storageSessionStorageEventCheckPropagation.html (limited to 'dom/tests/mochitest/storageevent') diff --git a/dom/tests/mochitest/storageevent/frameLocalStorageMaster.html b/dom/tests/mochitest/storageevent/frameLocalStorageMaster.html new file mode 100644 index 0000000000..55cbad1d28 --- /dev/null +++ b/dom/tests/mochitest/storageevent/frameLocalStorageMaster.html @@ -0,0 +1,63 @@ + + +master frame for event storage propagation + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/frameLocalStorageSlaveEqual.html b/dom/tests/mochitest/storageevent/frameLocalStorageSlaveEqual.html new file mode 100644 index 0000000000..ad3738bed2 --- /dev/null +++ b/dom/tests/mochitest/storageevent/frameLocalStorageSlaveEqual.html @@ -0,0 +1,55 @@ + + +slave for storage event propagation + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/frameLocalStorageSlaveNotEqual.html b/dom/tests/mochitest/storageevent/frameLocalStorageSlaveNotEqual.html new file mode 100644 index 0000000000..248604b400 --- /dev/null +++ b/dom/tests/mochitest/storageevent/frameLocalStorageSlaveNotEqual.html @@ -0,0 +1,39 @@ + + +slave for storage event propagation + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/frameSessionStorageMasterEqual.html b/dom/tests/mochitest/storageevent/frameSessionStorageMasterEqual.html new file mode 100644 index 0000000000..595e21351b --- /dev/null +++ b/dom/tests/mochitest/storageevent/frameSessionStorageMasterEqual.html @@ -0,0 +1,67 @@ + + +master frame for event storage propagation + + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/frameSessionStorageMasterNotEqual.html b/dom/tests/mochitest/storageevent/frameSessionStorageMasterNotEqual.html new file mode 100644 index 0000000000..6c66e085e0 --- /dev/null +++ b/dom/tests/mochitest/storageevent/frameSessionStorageMasterNotEqual.html @@ -0,0 +1,70 @@ + + +master frame for event storage propagation + + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/frameSessionStorageSlaveEqual.html b/dom/tests/mochitest/storageevent/frameSessionStorageSlaveEqual.html new file mode 100644 index 0000000000..c7326e9a89 --- /dev/null +++ b/dom/tests/mochitest/storageevent/frameSessionStorageSlaveEqual.html @@ -0,0 +1,59 @@ + + +slave for storage event propagation + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/frameSessionStorageSlaveNotEqual.html b/dom/tests/mochitest/storageevent/frameSessionStorageSlaveNotEqual.html new file mode 100644 index 0000000000..b86b3c02cc --- /dev/null +++ b/dom/tests/mochitest/storageevent/frameSessionStorageSlaveNotEqual.html @@ -0,0 +1,39 @@ + + +slave for storage event propagation + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/interOriginFrame.js b/dom/tests/mochitest/storageevent/interOriginFrame.js new file mode 100644 index 0000000000..f4b3d6c9ab --- /dev/null +++ b/dom/tests/mochitest/storageevent/interOriginFrame.js @@ -0,0 +1,63 @@ +let parentLocation = ""; + +// The first time this gets called in a page, the location of the parent +// should be passed in. This will be used as the target origin argument +// for the postMessage call for all subsequent calls to postMsg(). +function postMsg(message, newParentLocation) { + if (newParentLocation) { + parentLocation = newParentLocation; + } else if (parentLocation == "") { + throw new Error("Failed to pass in newParentLocation"); + } + + parent.postMessage(message, parentLocation); +} + +window.addEventListener("message", onMessageReceived); + +function onMessageReceived(event) { + if (event.data == "step") { + var performed = false; + try { + performed = doStep(); + } catch (ex) { + postMsg("FAILURE: exception threw at " + location + ":\n" + ex); + finishTest(); + } + + if (performed) { + postMsg("perf"); + } + + return; + } + + if (parent) { + postMsg(event.data); + } +} + +function ok(a, message) { + if (!a) { + postMsg("FAILURE: " + message); + } else { + postMsg(message); + } +} + +function is(a, b, message) { + if (a != b) { + postMsg("FAILURE: " + message + ", expected " + b + " got " + a); + } else { + postMsg(message + ", expected " + b + " got " + a); + } +} + +function todo(a, b, message) { + postMsg("TODO: " + message + ", expected " + b + " got " + a); +} + +function finishTest() { + postMsg("done"); + return false; +} diff --git a/dom/tests/mochitest/storageevent/interOriginTest2.js b/dom/tests/mochitest/storageevent/interOriginTest2.js new file mode 100644 index 0000000000..733f88a32d --- /dev/null +++ b/dom/tests/mochitest/storageevent/interOriginTest2.js @@ -0,0 +1,60 @@ +var frameLoadsPending = 2; + +var callMasterFrame = true; +var testDone = false; + +var masterFrameOrigin = ""; +var slaveFrameOrigin = ""; + +var failureRegExp = new RegExp("^FAILURE"); +var todoRegExp = new RegExp("^TODO"); + +const framePath = "/tests/dom/tests/mochitest/storageevent/"; + +window.addEventListener("message", onMessageReceived); + +function onMessageReceived(event) { + switch (event.data) { + // Indication of the frame onload event + case "frame loaded": + if (--frameLoadsPending) { + break; + } + + // Indication of successfully finished step of a test + // Just fall through... + case "perf": + if (callMasterFrame) { + masterFrame.postMessage("step", "*"); + } else if (slaveFrame) { + slaveFrame.postMessage("step", "*"); + } else if (masterFrame.slaveFrame) { + masterFrame.slaveFrame.postMessage("step", "*"); + } + callMasterFrame = !callMasterFrame; + break; + + // Indication of all test parts finish (from any of the frames) + case "done": + if (testDone) { + break; + } + + testDone = true; + SimpleTest.finish(); + break; + + // Any other message indicates error, succes or todo message of a test + default: + if (typeof event.data == "undefined") { + break; + } // XXXkhuey this receives undefined values + // (which used to become empty strings) on occasion ... + if (event.data.match(todoRegExp)) { + SimpleTest.todo(false, event.data); + } else { + SimpleTest.ok(!event.data.match(failureRegExp), event.data); + } + break; + } +} diff --git a/dom/tests/mochitest/storageevent/mochitest.toml b/dom/tests/mochitest/storageevent/mochitest.toml new file mode 100644 index 0000000000..6639b94d2a --- /dev/null +++ b/dom/tests/mochitest/storageevent/mochitest.toml @@ -0,0 +1,38 @@ +[DEFAULT] +support-files = [ + "frameLocalStorageMaster.html", + "frameLocalStorageSlaveEqual.html", + "frameLocalStorageSlaveNotEqual.html", + "frameSessionStorageMasterEqual.html", + "frameSessionStorageMasterNotEqual.html", + "frameSessionStorageSlaveEqual.html", + "frameSessionStorageSlaveNotEqual.html", + "interOriginFrame.js", + "interOriginTest2.js", +] + +["test_storageLocalStorageEventCheckNoPropagation.html"] +skip-if = [ + "http3", + "http2", +] + +["test_storageLocalStorageEventCheckPropagation.html"] +skip-if = [ + "http3", + "http2", +] + +["test_storageNotifications.html"] + +["test_storageSessionStorageEventCheckNoPropagation.html"] +skip-if = [ + "http3", + "http2", +] + +["test_storageSessionStorageEventCheckPropagation.html"] +skip-if = [ + "http3", + "http2", +] diff --git a/dom/tests/mochitest/storageevent/test_storageLocalStorageEventCheckNoPropagation.html b/dom/tests/mochitest/storageevent/test_storageLocalStorageEventCheckNoPropagation.html new file mode 100644 index 0000000000..ee48abedba --- /dev/null +++ b/dom/tests/mochitest/storageevent/test_storageLocalStorageEventCheckNoPropagation.html @@ -0,0 +1,43 @@ + + +storage event propagation test + + + + + + + + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/test_storageLocalStorageEventCheckPropagation.html b/dom/tests/mochitest/storageevent/test_storageLocalStorageEventCheckPropagation.html new file mode 100644 index 0000000000..a6d291e147 --- /dev/null +++ b/dom/tests/mochitest/storageevent/test_storageLocalStorageEventCheckPropagation.html @@ -0,0 +1,43 @@ + + +storage event propagation test + + + + + + + + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/test_storageNotifications.html b/dom/tests/mochitest/storageevent/test_storageNotifications.html new file mode 100644 index 0000000000..255de171de --- /dev/null +++ b/dom/tests/mochitest/storageevent/test_storageNotifications.html @@ -0,0 +1,130 @@ + + +sessionStorage basic test + + + + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/test_storageSessionStorageEventCheckNoPropagation.html b/dom/tests/mochitest/storageevent/test_storageSessionStorageEventCheckNoPropagation.html new file mode 100644 index 0000000000..7ffa70dbf6 --- /dev/null +++ b/dom/tests/mochitest/storageevent/test_storageSessionStorageEventCheckNoPropagation.html @@ -0,0 +1,43 @@ + + +storage event propagation test + + + + + + + + + + + + + + + diff --git a/dom/tests/mochitest/storageevent/test_storageSessionStorageEventCheckPropagation.html b/dom/tests/mochitest/storageevent/test_storageSessionStorageEventCheckPropagation.html new file mode 100644 index 0000000000..4f3402b6bb --- /dev/null +++ b/dom/tests/mochitest/storageevent/test_storageSessionStorageEventCheckPropagation.html @@ -0,0 +1,43 @@ + + +storage event propagation test + + + + + + + + + + + + + + + -- cgit v1.2.3