summaryrefslogtreecommitdiffstats
path: root/dom/events/test/test_dom_storage_event.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/events/test/test_dom_storage_event.html
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/events/test/test_dom_storage_event.html')
-rw-r--r--dom/events/test/test_dom_storage_event.html62
1 files changed, 62 insertions, 0 deletions
diff --git a/dom/events/test/test_dom_storage_event.html b/dom/events/test/test_dom_storage_event.html
new file mode 100644
index 0000000000..88cc288d41
--- /dev/null
+++ b/dom/events/test/test_dom_storage_event.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Test for DOM StorageEvent</title>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+<script type="application/javascript">
+
+const kTests = [
+ { createEventArg: "StorageEvent",
+ type: "aaa", bubbles: true, cancelable: true,
+ key: null, oldValue: 'a', newValue: 'b', url: 'c', storageArea: null },
+
+ { createEventArg: "storageevent",
+ type: "bbb", bubbles: false, cancelable: true,
+ key: 'key', oldValue: null, newValue: 'b', url: 'c', storageArea: null },
+
+ { createEventArg: "Storageevent",
+ type: "ccc", bubbles: true, cancelable: false,
+ key: 'key', oldValue: 'a', newValue: null, url: 'c', storageArea: null },
+
+ { createEventArg: "storageEvent",
+ type: "ddd", bubbles: false, cancelable: false,
+ key: 'key', oldValue: 'a', newValue: 'b', url: null, storageArea: null },
+
+ { createEventArg: "StorageEvent",
+ type: "eee", bubbles: true, cancelable: true,
+ key: 'key', oldValue: 'a', newValue: 'b', url: 'c', storageArea: null },
+
+ { createEventArg: "storageevent",
+ type: "fff", bubbles: false, cancelable: true,
+ key: null, oldValue: null, newValue: null, url: null, storageArea: null },
+ ];
+
+for (var i = 0; i < kTests.length; i++) {
+ var description = "test, Index: " + i + ", ";
+ const kTest = kTests[i];
+ var e = document.createEvent(kTest.createEventArg);
+ e.initStorageEvent(kTest.type, kTest.bubbles, kTest.cancelable,
+ kTest.key, kTest.oldValue, kTest.newValue, kTest.url,
+ kTest.storageArea);
+
+ for (var attr in kTest) {
+ if (attr == 'createEventArg')
+ continue;
+
+ is(e[attr], kTest[attr], description + attr + " returns wrong value");
+ }
+ is(e.isTrusted, false, description + "isTrusted returns wrong value");
+}
+
+</script>
+</pre>
+</body>
+</html>