summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/domstorage/events/script-tests/documentURI.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/storage/domstorage/events/script-tests/documentURI.js')
-rw-r--r--LayoutTests/storage/domstorage/events/script-tests/documentURI.js52
1 files changed, 52 insertions, 0 deletions
diff --git a/LayoutTests/storage/domstorage/events/script-tests/documentURI.js b/LayoutTests/storage/domstorage/events/script-tests/documentURI.js
new file mode 100644
index 0000000..4b4f4cb
--- /dev/null
+++ b/LayoutTests/storage/domstorage/events/script-tests/documentURI.js
@@ -0,0 +1,52 @@
+description("Test that changing documentURI has no effects on the uri passed into storage events.");
+
+function test(storageString, callback)
+{
+ window.completionCallback = callback;
+ window.storage = eval(storageString);
+ if (!storage) {
+ testFailed(storageString + " DOES NOT exist");
+ return;
+ }
+
+ debug("Testing " + storageString);
+
+ evalAndLog("storage.clear()");
+ shouldBe("storage.length", "0");
+
+ runAfterStorageEvents(step1);
+}
+
+function step1()
+{
+ debug("Reset storage event list");
+ evalAndLog("storageEventList = new Array()");
+ evalAndLog("storage.foo = '123'");
+
+ runAfterStorageEvents(step2);
+}
+
+function step2()
+{
+ shouldBe("storageEventList.length", "1");
+ debug("Saving URI");
+ window.lastURI = storageEventList[0].uri;
+
+ evalAndLog("document.documentURI = 'abc'");
+ shouldBeEqualToString("document.documentURI", "abc");
+ evalAndLog("storage.foo = 'xyz'");
+
+ runAfterStorageEvents(step3);
+}
+
+function step3()
+{
+ shouldBe("storageEventList.length", "2");
+ shouldBeTrue(String(window.lastURI == storageEventList[1].uri));
+
+ completionCallback();
+}
+
+testStorages(test);
+
+var successfullyParsed = true;