1 description("Test basic dom storage .clear() functionality.");
3 function test(storageString)
5 storage = eval(storageString);
7 testFailed(storageString + " DOES NOT exist");
11 debug("Testing " + storageString);
13 evalAndLog("storage.clear()");
14 shouldBe("storage.length", "0");
16 evalAndLog("storage['FOO'] = 'MyFOO'");
17 evalAndLog("storage['BAR'] = 'MyBar'");
18 shouldBe("storage.length", "2");
19 shouldBeEqualToString("storage['FOO']", "MyFOO");
20 shouldBeEqualToString("storage['BAR']", "MyBar");
22 evalAndLog("storage.clear()");
23 shouldBe("storage.length", "0");
24 shouldBe("storage['FOO']", "undefined"); // FIXME: Wait...shouldn't this be null?
25 shouldBe("storage['BAR']", "undefined"); // ditto
28 test("sessionStorage");
33 window.successfullyParsed = true;
34 isSuccessfullyParsed();