• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1description("Test that changing documentURI has no effects on the uri passed into storage events.");
2
3function test(storageString, callback)
4{
5    window.completionCallback = callback;
6    window.storage = eval(storageString);
7    if (!storage) {
8        testFailed(storageString + " DOES NOT exist");
9        return;
10    }
11
12    debug("Testing " + storageString);
13
14    evalAndLog("storage.clear()");
15    shouldBe("storage.length", "0");
16
17    runAfterStorageEvents(step1);
18}
19
20function step1()
21{
22    debug("Reset storage event list");
23    evalAndLog("storageEventList = new Array()");
24    evalAndLog("storage.foo = '123'");
25
26    runAfterStorageEvents(step2);
27}
28
29function step2()
30{
31    shouldBe("storageEventList.length", "1");
32    debug("Saving URI");
33    window.lastURI = storageEventList[0].uri;
34
35    evalAndLog("document.documentURI = 'abc'");
36    shouldBeEqualToString("document.documentURI", "abc");
37    evalAndLog("storage.foo = 'xyz'");
38
39    runAfterStorageEvents(step3);
40}
41
42function step3()
43{
44    shouldBe("storageEventList.length", "2");
45    shouldBeTrue(String(window.lastURI == storageEventList[1].uri));
46
47    completionCallback();
48}
49
50testStorages(test);
51
52var successfullyParsed = true;
53