[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
jorlow at chromium.org
jorlow at chromium.org
Thu Oct 29 20:39:49 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 1958368cb40c483cd6f47691f634d8e62a8cfbe6
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 6 06:58:08 2009 +0000
2009-10-05 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Darin Fisher.
Convert DOM Storage's "complex-values" test into the new format.
https://bugs.webkit.org/show_bug.cgi?id=30097
Convert DOM Storage's "complex-values" test into the new format and add it for
session storage. This also increases the coverage of these tests a bit.
* storage/domstorage/localstorage/complex-values-expected.txt:
* storage/domstorage/localstorage/complex-values.html:
* storage/domstorage/script-tests/complex-values.js: Added.
(handleStorageEvent):
(testKeyValue):
(runTest):
* storage/domstorage/sessionstorage/complex-values-expected.txt: Copied from LayoutTests/storage/domstorage/localstorage/complex-values-expected.txt.
* storage/domstorage/sessionstorage/complex-values.html: Copied from LayoutTests/storage/domstorage/localstorage/complex-values.html.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 824eda5..857b0e8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -2,6 +2,25 @@
Reviewed by Darin Fisher.
+ Convert DOM Storage's "complex-values" test into the new format.
+ https://bugs.webkit.org/show_bug.cgi?id=30097
+
+ Convert DOM Storage's "complex-values" test into the new format and add it for
+ session storage. This also increases the coverage of these tests a bit.
+
+ * storage/domstorage/localstorage/complex-values-expected.txt:
+ * storage/domstorage/localstorage/complex-values.html:
+ * storage/domstorage/script-tests/complex-values.js: Added.
+ (handleStorageEvent):
+ (testKeyValue):
+ (runTest):
+ * storage/domstorage/sessionstorage/complex-values-expected.txt: Copied from LayoutTests/storage/domstorage/localstorage/complex-values-expected.txt.
+ * storage/domstorage/sessionstorage/complex-values.html: Copied from LayoutTests/storage/domstorage/localstorage/complex-values.html.
+
+2009-10-05 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Darin Fisher.
+
Convert DOM Storage's "complex-keys" test into the new format
https://bugs.webkit.org/show_bug.cgi?id=30089
diff --git a/LayoutTests/storage/domstorage/localstorage/complex-values-expected.txt b/LayoutTests/storage/domstorage/localstorage/complex-values-expected.txt
index f9ffc3f..4b67f7d 100644
--- a/LayoutTests/storage/domstorage/localstorage/complex-values-expected.txt
+++ b/LayoutTests/storage/domstorage/localstorage/complex-values-expected.txt
@@ -1,32 +1,116 @@
-This test feeds a variety of corner case values into localStorage.
-Length is 0
-Type of foo with indexed getter is undefined
-Value for foo with indexed getter is undefined
-Type of foo with named property getter is undefined
-Value for foo with named property getter is undefined
-Type of foo with getItem is object
-Value for foo with getItem is null
-Length is 0
-Setting foo to null
-Type of foo is string
-Value for foo is null
-Setting foo to undefined
-Type of foo is string
-Value for foo is undefined
-Setting foo to 2
-Type of foo is string
-Value for foo is undefined
-Setting foo to bar with setItem
-Setting foo to BAR with setItem
-Value for foo is BAR
-Setting foo to bar with indexed setter
-Setting foo to BAR with indexed setter
-Value for foo is BAR
-Setting foo to bar with named property setter
-Setting foo to BAR with named property setter
-Value for foo is BAR
-Setting foo to a non-ascii string
-Value for foo is ÿ찡hello
-Value is the same: true
-Length is 1
+Test some corner case DOM Storage values.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing window.localStorage
+storage.clear()
+PASS storage.length is 0
+
+PASS typeof storage['foo'] is "undefined"
+PASS storage['foo'] is undefined.
+PASS typeof storage.foo is "undefined"
+PASS storage.foo is undefined.
+PASS typeof storage.getItem('foo') is "object"
+PASS storage.getItem('foo') is null
+
+storage.foo1 = null
+PASS typeof storage['foo1'] is "string"
+PASS storage['foo1'] is "null"
+PASS typeof storage.foo1 is "string"
+PASS storage.foo1 is "null"
+PASS typeof storage.getItem('foo1') is "string"
+PASS storage.getItem('foo1') is "null"
+storage['foo2'] = null
+PASS typeof storage['foo2'] is "string"
+PASS storage['foo2'] is "null"
+PASS typeof storage.foo2 is "string"
+PASS storage.foo2 is "null"
+PASS typeof storage.getItem('foo2') is "string"
+PASS storage.getItem('foo2') is "null"
+storage.setItem('foo3', null)
+PASS typeof storage['foo3'] is "string"
+PASS storage['foo3'] is "null"
+PASS typeof storage.foo3 is "string"
+PASS storage.foo3 is "null"
+PASS typeof storage.getItem('foo3') is "string"
+PASS storage.getItem('foo3') is "null"
+
+storage.foo4 = undefined
+PASS typeof storage['foo4'] is "string"
+PASS storage['foo4'] is "undefined"
+PASS typeof storage.foo4 is "string"
+PASS storage.foo4 is "undefined"
+PASS typeof storage.getItem('foo4') is "string"
+PASS storage.getItem('foo4') is "undefined"
+storage['foo5'] = undefined
+PASS typeof storage['foo5'] is "string"
+PASS storage['foo5'] is "undefined"
+PASS typeof storage.foo5 is "string"
+PASS storage.foo5 is "undefined"
+PASS typeof storage.getItem('foo5') is "string"
+PASS storage.getItem('foo5') is "undefined"
+storage.setItem('foo6', undefined)
+PASS typeof storage['foo6'] is "string"
+PASS storage['foo6'] is "undefined"
+PASS typeof storage.foo6 is "string"
+PASS storage.foo6 is "undefined"
+PASS typeof storage.getItem('foo6') is "string"
+PASS storage.getItem('foo6') is "undefined"
+
+storage.foo7 = 2
+PASS typeof storage['foo7'] is "string"
+PASS storage['foo7'] is "2"
+PASS typeof storage.foo7 is "string"
+PASS storage.foo7 is "2"
+PASS typeof storage.getItem('foo7') is "string"
+PASS storage.getItem('foo7') is "2"
+storage['foo8'] = 2
+PASS typeof storage['foo8'] is "string"
+PASS storage['foo8'] is "2"
+PASS typeof storage.foo8 is "string"
+PASS storage.foo8 is "2"
+PASS typeof storage.getItem('foo8') is "string"
+PASS storage.getItem('foo8') is "2"
+storage.setItem('foo9', 2)
+PASS typeof storage['foo9'] is "string"
+PASS storage['foo9'] is "2"
+PASS typeof storage.foo9 is "string"
+PASS storage.foo9 is "2"
+PASS typeof storage.getItem('foo9') is "string"
+PASS storage.getItem('foo9') is "2"
+
+storage.foo10 = k
+PASS typeof storage['foo10'] is "string"
+PASS storage['foo10'] is "ÿ찡hello"
+PASS typeof storage.foo10 is "string"
+PASS storage.foo10 is "ÿ찡hello"
+PASS typeof storage.getItem('foo10') is "string"
+PASS storage.getItem('foo10') is "ÿ찡hello"
+storage['foo11'] = k
+PASS typeof storage['foo11'] is "string"
+PASS storage['foo11'] is "ÿ찡hello"
+PASS typeof storage.foo11 is "string"
+PASS storage.foo11 is "ÿ찡hello"
+PASS typeof storage.getItem('foo11') is "string"
+PASS storage.getItem('foo11') is "ÿ찡hello"
+storage.setItem('foo12', k)
+PASS typeof storage['foo12'] is "string"
+PASS storage['foo12'] is "ÿ찡hello"
+PASS typeof storage.foo12 is "string"
+PASS storage.foo12 is "ÿ찡hello"
+PASS typeof storage.getItem('foo12') is "string"
+PASS storage.getItem('foo12') is "ÿ찡hello"
+
+Verify storage events are case sensitive
+storage.foo = 'test'
+Setting event listener
+PASS eventCounter is 0
+storage.foo = 'test'
+PASS eventCounter is 0
+storage.foo = 'TEST'
+PASS eventCounter is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
diff --git a/LayoutTests/storage/domstorage/localstorage/complex-values.html b/LayoutTests/storage/domstorage/localstorage/complex-values.html
index 0ee135c..78140e9 100644
--- a/LayoutTests/storage/domstorage/localstorage/complex-values.html
+++ b/LayoutTests/storage/domstorage/localstorage/complex-values.html
@@ -1,75 +1,15 @@
<html>
<head>
-<script src="resources/clearLocalStorage.js"></script>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="../script-tests/complex-values.js"></script>
<script>
-
-if (window.layoutTestController)
- layoutTestController.dumpAsText();
-
-function log(a)
-{
- document.getElementById("logger").innerHTML += a + "<br>";
-}
-
-function runTest()
-{
- if (!window.localStorage) {
- log("window.localStorage DOES NOT exist");
- return;
- }
-
- log("Length is " + localStorage.length);
- log("Type of foo with indexed getter is " + (typeof localStorage["foo"]));
- log("Value for foo with indexed getter is " + localStorage["foo"]);
- log("Type of foo with named property getter is " + (typeof localStorage.foo));
- log("Value for foo with named property getter is " + localStorage.foo);
- log("Type of foo with getItem is " + (typeof localStorage.getItem("foo")));
- log("Value for foo with getItem is " + localStorage.getItem("foo"));
-
- log("Length is " + localStorage.length);
- log("Setting foo to null");
- localStorage.setItem("foo", null);
- log("Type of foo is " + (typeof localStorage["foo"]));
- log("Value for foo is " + localStorage["foo"]);
- log("Setting foo to undefined");
- localStorage.foo = undefined;
- log("Type of foo is " + (typeof localStorage.getItem("foo")));
- log("Value for foo is " + localStorage.getItem("foo"));
- log("Setting foo to 2");
- localStorage.setItem["foo"] = 2;
- log("Type of foo is " + (typeof localStorage.foo));
- log("Value for foo is " + localStorage.foo);
-
- log("Setting foo to bar with setItem");
- localStorage.setItem("foo", "bar");
- log("Setting foo to BAR with setItem");
- localStorage.setItem("foo", "BAR");
- log("Value for foo is " + localStorage.foo);
-
- log("Setting foo to bar with indexed setter");
- localStorage["foo"] = "bar";
- log("Setting foo to BAR with indexed setter");
- localStorage["foo"] = "BAR";
- log("Value for foo is " + localStorage.foo);
-
- log("Setting foo to bar with named property setter");
- localStorage.foo = "bar";
- log("Setting foo to BAR with named property setter");
- localStorage.foo = "BAR";
- log("Value for foo is " + localStorage.foo);
-
- v = String.fromCharCode(255425) + String.fromCharCode(255) + String.fromCharCode(2554252321) + String.fromCharCode(0) + 'hello';
- log("Setting foo to a non-ascii string");
- localStorage.foo = v;
- log("Value for foo is " + localStorage.foo);
- log("Value is the same: " + (localStorage.foo == v));
- log("Length is " + localStorage.length);
-}
-
+runTest("window.localStorage");
</script>
-</head>
-<body onload="runTest();">
-This test feeds a variety of corner case values into localStorage.<br>
-<div id="logger"></div>
+<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
diff --git a/LayoutTests/storage/domstorage/script-tests/complex-values.js b/LayoutTests/storage/domstorage/script-tests/complex-values.js
new file mode 100644
index 0000000..c752a70
--- /dev/null
+++ b/LayoutTests/storage/domstorage/script-tests/complex-values.js
@@ -0,0 +1,89 @@
+description("Test some corner case DOM Storage values.");
+
+eventCounter = 0;
+function handleStorageEvent() {
+ eventCounter++;
+}
+
+function testKeyValue(key, value)
+{
+ keyString = "storage['" + key + "']";
+ shouldBeEqualToString("typeof " + keyString, "string");
+ shouldBeEqualToString(keyString, value);
+
+ keyString = "storage." + key;
+ shouldBeEqualToString("typeof " + keyString, "string");
+ shouldBeEqualToString(keyString, value);
+
+ keyString = "storage.getItem('" + key + "')";
+ shouldBeEqualToString("typeof " + keyString, "string");
+ shouldBeEqualToString(keyString, value);
+}
+
+function runTest(storageString)
+{
+ storage = eval(storageString);
+ if (!storage) {
+ testFailed(storageString + " DOES NOT exist");
+ return;
+ }
+
+ debug("Testing " + storageString);
+
+ evalAndLog("storage.clear()");
+ shouldBe("storage.length", "0");
+
+ debug("");
+ shouldBeEqualToString("typeof storage['foo']", "undefined");
+ shouldBeUndefined("storage['foo']");
+ shouldBeEqualToString("typeof storage.foo", "undefined");
+ shouldBeUndefined("storage.foo");
+ shouldBeEqualToString("typeof storage.getItem('foo')", "object");
+ shouldBeNull("storage.getItem('foo')");
+
+ debug("");
+ evalAndLog("storage.foo1 = null");
+ testKeyValue("foo1", "null");
+ evalAndLog("storage['foo2'] = null");
+ testKeyValue("foo2", "null");
+ evalAndLog("storage.setItem('foo3', null)");
+ testKeyValue("foo3", "null");
+
+ debug("");
+ evalAndLog("storage.foo4 = undefined");
+ testKeyValue("foo4", "undefined");
+ evalAndLog("storage['foo5'] = undefined");
+ testKeyValue("foo5", "undefined");
+ evalAndLog("storage.setItem('foo6', undefined)");
+ testKeyValue("foo6", "undefined");
+
+ debug("");
+ evalAndLog("storage.foo7 = 2");
+ testKeyValue("foo7", "2");
+ evalAndLog("storage['foo8'] = 2");
+ testKeyValue("foo8", "2");
+ evalAndLog("storage.setItem('foo9', 2)");
+ testKeyValue("foo9", "2");
+
+ debug("");
+ k = String.fromCharCode(255425) + String.fromCharCode(255) + String.fromCharCode(2554252321) + String.fromCharCode(0) + 'hello';
+ evalAndLog("storage.foo10 = k");
+ testKeyValue("foo10", k);
+ evalAndLog("storage['foo11'] = k");
+ testKeyValue("foo11", k);
+ evalAndLog("storage.setItem('foo12', k)");
+ testKeyValue("foo12", k);
+
+ debug("");
+ debug("Verify storage events are case sensitive");
+ evalAndLog("storage.foo = 'test'");
+ debug("Setting event listener");
+ window.addEventListener("storage", handleStorageEvent, false);
+ shouldBe("eventCounter", "0");
+ evalAndLog("storage.foo = 'test'");
+ shouldBe("eventCounter", "0");
+ evalAndLog("storage.foo = 'TEST'");
+ shouldBe("eventCounter", "1");
+
+ window.successfullyParsed = true;
+}
diff --git a/LayoutTests/storage/domstorage/sessionstorage/complex-values-expected.txt b/LayoutTests/storage/domstorage/sessionstorage/complex-values-expected.txt
new file mode 100644
index 0000000..4527937
--- /dev/null
+++ b/LayoutTests/storage/domstorage/sessionstorage/complex-values-expected.txt
@@ -0,0 +1,116 @@
+Test some corner case DOM Storage values.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing window.sessionStorage
+storage.clear()
+PASS storage.length is 0
+
+PASS typeof storage['foo'] is "undefined"
+PASS storage['foo'] is undefined.
+PASS typeof storage.foo is "undefined"
+PASS storage.foo is undefined.
+PASS typeof storage.getItem('foo') is "object"
+PASS storage.getItem('foo') is null
+
+storage.foo1 = null
+PASS typeof storage['foo1'] is "string"
+PASS storage['foo1'] is "null"
+PASS typeof storage.foo1 is "string"
+PASS storage.foo1 is "null"
+PASS typeof storage.getItem('foo1') is "string"
+PASS storage.getItem('foo1') is "null"
+storage['foo2'] = null
+PASS typeof storage['foo2'] is "string"
+PASS storage['foo2'] is "null"
+PASS typeof storage.foo2 is "string"
+PASS storage.foo2 is "null"
+PASS typeof storage.getItem('foo2') is "string"
+PASS storage.getItem('foo2') is "null"
+storage.setItem('foo3', null)
+PASS typeof storage['foo3'] is "string"
+PASS storage['foo3'] is "null"
+PASS typeof storage.foo3 is "string"
+PASS storage.foo3 is "null"
+PASS typeof storage.getItem('foo3') is "string"
+PASS storage.getItem('foo3') is "null"
+
+storage.foo4 = undefined
+PASS typeof storage['foo4'] is "string"
+PASS storage['foo4'] is "undefined"
+PASS typeof storage.foo4 is "string"
+PASS storage.foo4 is "undefined"
+PASS typeof storage.getItem('foo4') is "string"
+PASS storage.getItem('foo4') is "undefined"
+storage['foo5'] = undefined
+PASS typeof storage['foo5'] is "string"
+PASS storage['foo5'] is "undefined"
+PASS typeof storage.foo5 is "string"
+PASS storage.foo5 is "undefined"
+PASS typeof storage.getItem('foo5') is "string"
+PASS storage.getItem('foo5') is "undefined"
+storage.setItem('foo6', undefined)
+PASS typeof storage['foo6'] is "string"
+PASS storage['foo6'] is "undefined"
+PASS typeof storage.foo6 is "string"
+PASS storage.foo6 is "undefined"
+PASS typeof storage.getItem('foo6') is "string"
+PASS storage.getItem('foo6') is "undefined"
+
+storage.foo7 = 2
+PASS typeof storage['foo7'] is "string"
+PASS storage['foo7'] is "2"
+PASS typeof storage.foo7 is "string"
+PASS storage.foo7 is "2"
+PASS typeof storage.getItem('foo7') is "string"
+PASS storage.getItem('foo7') is "2"
+storage['foo8'] = 2
+PASS typeof storage['foo8'] is "string"
+PASS storage['foo8'] is "2"
+PASS typeof storage.foo8 is "string"
+PASS storage.foo8 is "2"
+PASS typeof storage.getItem('foo8') is "string"
+PASS storage.getItem('foo8') is "2"
+storage.setItem('foo9', 2)
+PASS typeof storage['foo9'] is "string"
+PASS storage['foo9'] is "2"
+PASS typeof storage.foo9 is "string"
+PASS storage.foo9 is "2"
+PASS typeof storage.getItem('foo9') is "string"
+PASS storage.getItem('foo9') is "2"
+
+storage.foo10 = k
+PASS typeof storage['foo10'] is "string"
+PASS storage['foo10'] is "ÿ찡hello"
+PASS typeof storage.foo10 is "string"
+PASS storage.foo10 is "ÿ찡hello"
+PASS typeof storage.getItem('foo10') is "string"
+PASS storage.getItem('foo10') is "ÿ찡hello"
+storage['foo11'] = k
+PASS typeof storage['foo11'] is "string"
+PASS storage['foo11'] is "ÿ찡hello"
+PASS typeof storage.foo11 is "string"
+PASS storage.foo11 is "ÿ찡hello"
+PASS typeof storage.getItem('foo11') is "string"
+PASS storage.getItem('foo11') is "ÿ찡hello"
+storage.setItem('foo12', k)
+PASS typeof storage['foo12'] is "string"
+PASS storage['foo12'] is "ÿ찡hello"
+PASS typeof storage.foo12 is "string"
+PASS storage.foo12 is "ÿ찡hello"
+PASS typeof storage.getItem('foo12') is "string"
+PASS storage.getItem('foo12') is "ÿ찡hello"
+
+Verify storage events are case sensitive
+storage.foo = 'test'
+Setting event listener
+PASS eventCounter is 0
+storage.foo = 'test'
+PASS eventCounter is 0
+storage.foo = 'TEST'
+PASS eventCounter is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/domstorage/sessionstorage/complex-values.html b/LayoutTests/storage/domstorage/sessionstorage/complex-values.html
new file mode 100644
index 0000000..73de3da
--- /dev/null
+++ b/LayoutTests/storage/domstorage/sessionstorage/complex-values.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="../script-tests/complex-values.js"></script>
+<script>
+runTest("window.sessionStorage");
+</script>
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list