summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-25 19:08:45 +0100
committerSteve Block <steveblock@google.com>2011-06-08 13:51:31 +0100
commit2bde8e466a4451c7319e3a072d118917957d6554 (patch)
tree28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /LayoutTests
parent6939c99b71d9372d14a0c74a772108052e8c48c8 (diff)
downloadexternal_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip
external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz
external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr-expected.txt5
-rw-r--r--LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr-expected.txt5
-rw-r--r--LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt3
-rw-r--r--LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt3
-rw-r--r--LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests-expected.txt10
-rw-r--r--LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests.html13
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/page-reload-cancel-permission-requests-inner.html7
-rw-r--r--LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html4
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js44
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js6
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/invalid-form-field-expected.txt5
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/invalid-form-field.html45
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents-expected.txt5
-rw-r--r--LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents.html45
-rw-r--r--LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt2
-rw-r--r--LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html14
-rw-r--r--LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt6
-rw-r--r--LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html25
-rw-r--r--LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt1
-rw-r--r--LayoutTests/fast/js/resources/js-constructors-use-correct-global.js16
-rw-r--r--LayoutTests/http/tests/appcache/origin-delete-expected.txt7
-rw-r--r--LayoutTests/http/tests/appcache/origin-delete.html58
-rw-r--r--LayoutTests/http/tests/appcache/origins-with-appcache-expected.txt5
-rw-r--r--LayoutTests/http/tests/appcache/origins-with-appcache.html57
-rw-r--r--LayoutTests/http/tests/appcache/resources/origin-delete-iframe.html20
-rw-r--r--LayoutTests/http/tests/appcache/resources/origin-delete-iframe.manifest6
-rw-r--r--LayoutTests/http/tests/appcache/resources/origins-with-appcache-iframe.html9
-rw-r--r--LayoutTests/http/tests/appcache/resources/origins-with-appcache-iframe.manifest6
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare-expected.txt10
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare.html44
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create-expected.txt10
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html47
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all-expected.txt10
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all.html47
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-4-create-expected.txt11
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-4-create.html47
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one-expected.txt10
-rw-r--r--LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one.html47
38 files changed, 699 insertions, 16 deletions
diff --git a/LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr-expected.txt
index 7b6e36d..523b7df 100644
--- a/LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr-expected.txt
+++ b/LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr-expected.txt
@@ -1,2 +1,3 @@
-Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementwrongdocumenterr
-Status: Success
+Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementwrongdocumenterr
+Status: failure
+Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed
diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr-expected.txt
index 63a88c9..3e453f6 100644
--- a/LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr-expected.txt
+++ b/LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr-expected.txt
@@ -1,2 +1,3 @@
-Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapwrongdocumenterr
-Status: Success
+Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapwrongdocumenterr
+Status: failure
+Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed
diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt
index 86c1d64..9870840 100644
--- a/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt
+++ b/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt
@@ -1,2 +1,3 @@
Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementwrongdocumenterr
-Status Success
+Status failure
+Message throw_WRONG_DOCUMENT_ERR: assertTrue failed
diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt
index ab021e2..aea8102 100644
--- a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt
+++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt
@@ -1,2 +1,3 @@
Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapwrongdocumenterr
-Status Success
+Status failure
+Message throw_WRONG_DOCUMENT_ERR: assertTrue failed
diff --git a/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests-expected.txt b/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests-expected.txt
new file mode 100644
index 0000000..c7f2d2b
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests-expected.txt
@@ -0,0 +1,10 @@
+Tests that when a page is reloaded, the frame is properly detached from the Geolocation object to ensure that no permission requests are in progress.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS numPendingRequests is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests.html b/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests.html
new file mode 100644
index 0000000..5b6aa5c
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/page-reload-cancel-permission-requests.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/page-reload-cancel-permission-requests.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/page-reload-cancel-permission-requests-inner.html b/LayoutTests/fast/dom/Geolocation/resources/page-reload-cancel-permission-requests-inner.html
new file mode 100644
index 0000000..4a4a715
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/resources/page-reload-cancel-permission-requests-inner.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ </head>
+ <body onload="window.parent.onIframeReady()">
+ </body>
+</html>
diff --git a/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html b/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html
index cfeabae..5370b4c 100644
--- a/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html
+++ b/LayoutTests/fast/dom/Geolocation/resources/window-close-popup.html
@@ -11,9 +11,7 @@ function loadNext() {
layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
}
- navigator.geolocation.watchPosition(
- function(p) { window.opener.gotPosition(); },
- function(e) { window.opener.failedToCreateWatch(e); });
+ navigator.geolocation.watchPosition(window.opener.gotPosition);
}
</script>
<body onload="loadNext()"></body>
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js b/LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js
new file mode 100644
index 0000000..7ac291b
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js
@@ -0,0 +1,44 @@
+description("Tests that when a page is reloaded, the frame is properly detached from the Geolocation object " +
+ "to ensure that no permission requests are in progress.");
+
+window.jsTestIsAsync = true;
+
+var numPendingRequests;
+var isReload = false;
+
+if ("#reload" == location.hash)
+ isReload = true;
+
+if (window.layoutTestController) {
+ numPendingRequests = layoutTestController.numberOfPendingGeolocationPermissionRequests();
+ shouldBe('numPendingRequests', '0');
+
+ if (isReload)
+ finishJSTest();
+}
+
+if (!isReload) {
+ // Kick off a position request and then reload the page, this should set up
+ // a permission request. Permission should be undecided at this point, so the
+ // permission request should still be outstanding by page reload.
+
+ function onIframeReady()
+ {
+ // Make request on remote frame's Geolocation object.
+ iframe.contentWindow.navigator.geolocation.getCurrentPosition(
+ function(p) {
+ testFailed('Permission should not be determined for this page: ' + p);
+ finishJSTest();
+ });
+
+ location.hash = '#reload';
+ location.reload();
+ }
+
+ debug("Create IFrame");
+ var iframe = document.createElement('iframe');
+ iframe.src = 'resources/page-reload-cancel-permission-requests-inner.html';
+ document.body.appendChild(iframe);
+}
+
+window.successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js b/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js
index b27df61..a8f2bda 100644
--- a/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js
@@ -28,12 +28,6 @@ function waitForWindowToClose()
finishJSTest();
}
-function failedToCreateWatch(e)
-{
- testFailed("Failed to create watch: " + e);
- finishJSTest();
-}
-
debug("Main page opening resources/window-close-popup.html");
otherWindow = window.open("resources/window-close-popup.html");
diff --git a/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field-expected.txt b/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field-expected.txt
new file mode 100644
index 0000000..a2dc689
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field-expected.txt
@@ -0,0 +1,5 @@
+PASS str is 'threw exception'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field.html b/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field.html
new file mode 100644
index 0000000..309ab10
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/invalid-form-field.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id="test">
+ <div id="console"></div>
+</body>
+<script>
+window.jsTestIsAsync = true;
+
+var form, input, str;
+
+window.onload = function()
+{
+ form = document.body.appendChild(document.createElement("form"));
+ form.id = "form";
+
+ input = document.createElement("input");
+ input.id = "input";
+ input.setAttribute("form", "form");
+ form.elements.namedItem("input");
+
+ input = null;
+
+ gc();
+ setTimeout(step2, 100);
+}
+
+function step2()
+{
+ try {
+ str = typeof form['input'].form;
+ } catch(e) {
+ str = 'threw exception';
+ }
+ shouldBe("str", "'threw exception'");
+ finishJSTest();
+}
+
+window.successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents-expected.txt b/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents-expected.txt
new file mode 100644
index 0000000..da58066
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents-expected.txt
@@ -0,0 +1,5 @@
+PASS typeof select.options.namedItem('option') is 'undefined'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents.html b/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents.html
new file mode 100644
index 0000000..bf8ffd1
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLFormElement/move-option-between-documents.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id="test">
+ <div id="console"></div>
+</body>
+<script>
+window.jsTestIsAsync = true;
+
+var select, doc1, doc2, str;
+
+window.onload = function()
+{
+ select = document.createElement("select");
+ var option = select.appendChild(document.createElement("option"));
+ option.id = "option";
+
+ doc1 = document.implementation.createHTMLDocument();
+ doc2 = document.implementation.createHTMLDocument();
+
+ doc1.body.appendChild(select);
+ select.options.namedItem("option");
+
+ select.removeChild(option);
+ option = null;
+
+ gc();
+ setTimeout(step2, 100);
+}
+
+function step2()
+{
+ doc1.body.removeChild(select);
+ doc2.body.appendChild(select);
+ shouldBe("typeof select.options.namedItem('option')", "'undefined'");
+ finishJSTest();
+}
+
+window.successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</html>
diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt
new file mode 100644
index 0000000..c7fb018
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt
@@ -0,0 +1,2 @@
+PASS beforeload called
+This test will only print "PASS" or "FAIL" if link prefetches are enabled, otherwise it will show nothing below.
diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html
new file mode 100644
index 0000000..27a62af
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html
@@ -0,0 +1,14 @@
+<body>
+<div id="console"></div>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+}
+</script>
+<html>
+<p>This test will only print "PASS" or "FAIL" if link prefetches are
+enabled, otherwise it will show nothing below.</p>
+<link href="prefetch.link" rel="prefetch" onbeforeload="testPassed('beforeload called');return false" onload="testFailed('onload')" onerror="testFailed('onerror')" />
+</html>
+
diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt
new file mode 100644
index 0000000..47fc987
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt
@@ -0,0 +1,6 @@
+This tests that onerror events can be attached to link elements with rel=prefetch. Since prefetch links are just there as a performance optimization, the onerror/onload event is their only programatic side-effect.
+
+If it works you should see a message below saying the test has passed.
+
+PASS onerror was called
+
diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html
new file mode 100644
index 0000000..07ced9e
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script type="text/javascript">
+function done()
+{
+ testPassed('onerror was called');
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body>
+<p>This tests that onerror events can be attached to link elements with rel=prefetch. Since prefetch links are just there as a performance optimization, the onerror/onload event is their only programatic side-effect.</p>
+<p>If it works you should see a message below saying the test has passed.</p>
+<link href="prefetch-noexisty.link" rel="prefetch" onload="testFailed('onload event should not occur')" onerror="done()">
+<hr>
+<div id="console"></div>
+</body>
+</html>
+
diff --git a/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt b/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt
index 4aea68a..15ca8a8 100644
--- a/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt
+++ b/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt
@@ -2,4 +2,3 @@ This XML file does not appear to have any style information associated with it.
<TEST>
Should be "CYRILLIC SMALL LETTER IO" (like e with diaeresis): ё
</TEST>
-
diff --git a/LayoutTests/fast/js/resources/js-constructors-use-correct-global.js b/LayoutTests/fast/js/resources/js-constructors-use-correct-global.js
new file mode 100644
index 0000000..df8cb08
--- /dev/null
+++ b/LayoutTests/fast/js/resources/js-constructors-use-correct-global.js
@@ -0,0 +1,16 @@
+description("Test to ensure that js constructors create objects with the correct constructor");
+
+var otherGlobal = document.getElementsByTagName("iframe")[0].contentWindow;
+var constructors = ["Object", "Function", "Array", "Number", "String", "Boolean", "RegExp", "Date", "Error", "RangeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "Image"];
+
+for (var i = 0; i < constructors.length; i++) {
+ shouldBeTrue("new otherGlobal." + constructors[i] + "() instanceof otherGlobal." + constructors[i]);
+ try {
+ if ((typeof (otherGlobal[constructors[i]]())) === "object" || (typeof (otherGlobal[constructors[i]]())) === "function")
+ shouldBeTrue("otherGlobal." + constructors[i] + "() instanceof otherGlobal." + constructors[i]);
+ } catch(e) {
+
+ }
+}
+
+successfullyParsed = true;
diff --git a/LayoutTests/http/tests/appcache/origin-delete-expected.txt b/LayoutTests/http/tests/appcache/origin-delete-expected.txt
new file mode 100644
index 0000000..e91767d
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/origin-delete-expected.txt
@@ -0,0 +1,7 @@
+This test checks that application cache groups correctly become obsolete after application cache is deletion for a specific origin.
+
+PASS - cached iframe-1
+clearing cache for origin
+appcache_status=5
+SUCCESS - cache was made obsolete
+
diff --git a/LayoutTests/http/tests/appcache/origin-delete.html b/LayoutTests/http/tests/appcache/origin-delete.html
new file mode 100644
index 0000000..26c4890
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/origin-delete.html
@@ -0,0 +1,58 @@
+<html>
+<head>
+<script>
+
+// Helpers.
+
+function log(message) {
+ document.getElementById("console").innerHTML += message + "<br>";
+}
+
+// Start and end.
+
+function startTest() {
+ if (window.layoutTestController) {
+ layoutTestController.clearAllApplicationCaches();
+ layoutTestController.dumpApplicationCacheDelegateCallbacks();
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ addIFrameWithAppCache();
+}
+
+function finishTest() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function addIFrameWithAppCache() {
+ var iframe = document.createElement("iframe");
+ iframe.src = "resources/origin-delete-iframe.html";
+ iframe.id = "cachedFrame";
+ document.body.appendChild(iframe);
+
+ window.onmessage = function(event) {
+ log(event.data);
+ if (event.data === "PASS - cached iframe-1") {
+ log("clearing cache for origin");
+ layoutTestController.clearApplicationCacheForOrigin("http://127.0.0.1:8000");
+ var frame = document.getElementById('cachedFrame');
+ frame.contentWindow.postMessage("appcache_status", "*");
+ } else if (event.data === "appcache_status=5"){
+ log("SUCCESS - cache was made obsolete");
+ finishTest();
+ } else {
+ log("FAIL - received unexpected message " + event.data);
+ finishTest();
+ }
+ };
+}
+</script>
+</head>
+<body onload="startTest()">
+<p>This test checks that application cache groups correctly become obsolete after application cache is deletion for a specific origin.
+</p>
+<pre id="console"></pre>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/origins-with-appcache-expected.txt b/LayoutTests/http/tests/appcache/origins-with-appcache-expected.txt
new file mode 100644
index 0000000..e3b20f6
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/origins-with-appcache-expected.txt
@@ -0,0 +1,5 @@
+This test verifies that ApplicationCacheStorage can report the set of origins that have an application cache. First, it tests that no origins are reported after all application caches are removed. Then, it loads an iframe that places a PNG into an application cache for the DumpRenderTree origin, and tests that this origin is now reported to have application cache.
+
+Origins with application cache after deletion:
+Origins with application cache after frame was cached: http_127.0.0.1_8000
+
diff --git a/LayoutTests/http/tests/appcache/origins-with-appcache.html b/LayoutTests/http/tests/appcache/origins-with-appcache.html
new file mode 100644
index 0000000..0730f12
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/origins-with-appcache.html
@@ -0,0 +1,57 @@
+<html>
+<head>
+<script>
+
+// Helpers.
+
+function log(message) {
+ document.getElementById("console").innerHTML += message + "<br>";
+}
+
+function handleMessage(event) {
+ if (event.data === "created_cache") {
+ log("Origins with application cache after frame was cached: " + layoutTestController.originsWithApplicationCache());
+ } else {
+ log("received invalid message from frame '" + event.data + "'");
+ }
+
+ finishTest();
+}
+
+function addIFrameWithCache()
+{
+ var iframe = document.createElement("iframe");
+ iframe.src = "resources/origins-with-appcache-iframe.html";
+ document.body.appendChild(iframe);
+}
+
+// Start and end.
+
+function startTest() {
+ if (window.layoutTestController) {
+ layoutTestController.clearAllApplicationCaches();
+ log("Origins with application cache after deletion: " + layoutTestController.originsWithApplicationCache());
+ layoutTestController.dumpApplicationCacheDelegateCallbacks();
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ window.onmessage = handleMessage;
+
+ addIFrameWithCache();
+}
+
+function finishTest() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+</script>
+</head>
+<body onload="startTest()">
+<p>
+This test verifies that ApplicationCacheStorage can report the set of origins that have an application cache. First, it tests that no origins are reported after all application caches are removed. Then, it loads an iframe that places a PNG into an application cache for the DumpRenderTree origin, and tests that this origin is now reported to have application cache.
+</p>
+<pre id="console"></pre>
+</body>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/origin-delete-iframe.html b/LayoutTests/http/tests/appcache/resources/origin-delete-iframe.html
new file mode 100644
index 0000000..e2565f7
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/origin-delete-iframe.html
@@ -0,0 +1,20 @@
+<html manifest="origin-delete-iframe.manifest">
+<script>
+// iframe-1 is expected to succeed.
+applicationCache.oncached = function() { parent.postMessage("PASS - cached iframe-1", "*"); };
+applicationCache.onerror = function() { parent.postMessage("FAIL - error caching iframe-1, expected this to succeed", "*"); };
+applicationCache.onnoupdate = function() { parent.postMessage("FAIL - no update iframe-1, all caches should have been deleted before this test", "*"); };
+
+
+function frameMessageReceived(event) {
+ if (event.data === "appcache_status") {
+ parent.postMessage("appcache_status=" + applicationCache.status, "*");
+ } else {
+ parent.postMessage("FAIL - unrecognized message", "*");
+ }
+}
+
+window.addEventListener("message", frameMessageReceived, false);
+
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/origin-delete-iframe.manifest b/LayoutTests/http/tests/appcache/resources/origin-delete-iframe.manifest
new file mode 100644
index 0000000..6b48448
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/origin-delete-iframe.manifest
@@ -0,0 +1,6 @@
+CACHE MANIFEST
+
+# This adds ~13K to the app cache
+
+CACHE:
+abe.png
diff --git a/LayoutTests/http/tests/appcache/resources/origins-with-appcache-iframe.html b/LayoutTests/http/tests/appcache/resources/origins-with-appcache-iframe.html
new file mode 100644
index 0000000..92cf1ff
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/origins-with-appcache-iframe.html
@@ -0,0 +1,9 @@
+<html manifest="origins-with-appcache-iframe.manifest">
+<script>
+// iframe-1 is expected to succeed.
+applicationCache.oncached = function() { parent.postMessage("created_cache", "*"); };
+applicationCache.onerror = function() { parent.postMessage("FAIL - error caching iframe, expected this to succeed", "*"); };
+applicationCache.onnoupdate = function() { parent.postMessage("FAIL - no update iframe, all caches should have been deleted before this test", "*"); };
+
+</script>
+</html>
diff --git a/LayoutTests/http/tests/appcache/resources/origins-with-appcache-iframe.manifest b/LayoutTests/http/tests/appcache/resources/origins-with-appcache-iframe.manifest
new file mode 100644
index 0000000..6b48448
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/origins-with-appcache-iframe.manifest
@@ -0,0 +1,6 @@
+CACHE MANIFEST
+
+# This adds ~13K to the app cache
+
+CACHE:
+abe.png
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare-expected.txt b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare-expected.txt
new file mode 100644
index 0000000..5cca432
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare-expected.txt
@@ -0,0 +1,10 @@
+Prepare for StorageTracker tests by ensuring that every origin with local storage is deleted.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+This test should have no visible output on success.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare.html b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare.html
new file mode 100644
index 0000000..a0a09ff
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-1-prepare.html
@@ -0,0 +1,44 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
+<script src="../../../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("Prepare for StorageTracker tests by ensuring that every origin with local storage is deleted.");
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function finishTest() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function test()
+{
+ if (!window.localStorage) {
+ testFailed("localStorage DOES NOT exist");
+ return;
+ }
+
+ debug("This test should have no visible output on success.");
+
+ if (layoutTestController.originsWithLocalStorage().length > 0) {
+ layoutTestController.observeStorageTrackerNotifications(1);
+ layoutTestController.deleteAllLocalStorage();
+ } else {
+ finishTest();
+ }
+}
+
+test();
+
+window.successfullyParsed = true;
+isSuccessfullyParsed();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create-expected.txt b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create-expected.txt
new file mode 100644
index 0000000..5ae4ee1
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create-expected.txt
@@ -0,0 +1,10 @@
+Origin identifier: 'file__0'
+StorageTracker test - write local storage for this origin. Should be called after origins-prepare.html.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html
new file mode 100644
index 0000000..20f4f3d
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-2-create.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
+<script src="../../../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("StorageTracker test - write local storage for this origin. Should be called after origins-prepare.html.");
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function finishTest() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function test()
+{
+ if (!window.localStorage) {
+ testFailed("localStorage DOES NOT exist");
+ return;
+ }
+
+ if (layoutTestController.originsWithLocalStorage().length > 0) {
+ // An origin already exists so we can exit.
+ testFailed("An origin already existed with local storage.");
+ layoutTestController.notifyDone();
+ } else {
+ layoutTestController.syncLocalStorage();
+
+ localStorage.someData = 'writeme';
+ // LayoutTestController's notifyDone will be called after the origin change notification comes in.
+ layoutTestController.observeStorageTrackerNotifications(1);
+ }
+}
+
+test();
+
+window.successfullyParsed = true;
+isSuccessfullyParsed();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all-expected.txt b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all-expected.txt
new file mode 100644
index 0000000..da480d9
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all-expected.txt
@@ -0,0 +1,10 @@
+Test API to view origins that have local storage and to delete local storage by origin.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS layoutTestController.originsWithLocalStorage().toString() is "file__0"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all.html b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all.html
new file mode 100644
index 0000000..16da440
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-3-delete-all.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
+<script src="../../../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("Test API to view origins that have local storage and to delete local storage by origin.");
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function finishTest() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function test()
+{
+ if (!window.localStorage) {
+ testFailed("localStorage DOES NOT exist");
+ return;
+ }
+
+ if (layoutTestController.originsWithLocalStorage().length > 0) {
+ shouldBeEqualToString("layoutTestController.originsWithLocalStorage().toString()", "file__0");
+ // We're just going to delete the existing origin, so we'll get one origin change notification.
+ layoutTestController.observeStorageTrackerNotifications(1);
+ layoutTestController.deleteAllLocalStorage();
+ } else {
+ layoutTestController.notifyDone();
+ testFailed("Ran with no origins with local storage");
+ }
+
+ // At this point, we're guaranteed to have one origin with local storage.
+}
+
+test();
+
+window.successfullyParsed = true;
+isSuccessfullyParsed();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-4-create-expected.txt b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-4-create-expected.txt
new file mode 100644
index 0000000..ab6ea2b
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-4-create-expected.txt
@@ -0,0 +1,11 @@
+Origin identifier: 'file__0'
+StorageTracker test - write local storage for this origin. Should be called after storage-tracker-3-delete-all.html.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+This test should have no visible output on success.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-4-create.html b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-4-create.html
new file mode 100644
index 0000000..c066fb4
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-4-create.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
+<script src="../../../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("StorageTracker test - write local storage for this origin. Should be called after storage-tracker-3-delete-all.html.");
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function finishTest() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function test()
+{
+ if (!window.localStorage) {
+ testFailed("localStorage DOES NOT exist");
+ return;
+ }
+
+ debug("This test should have no visible output on success.");
+
+ if (layoutTestController.originsWithLocalStorage().length > 0) {
+ // An origin already exists so we can exit.
+ testFailed("An origin already existed with local storage.");
+ layoutTestController.notifyDone();
+ } else {
+ layoutTestController.syncLocalStorage();
+ localStorage.someOtherData = 'writemeMore';
+ layoutTestController.observeStorageTrackerNotifications(1);
+ }
+}
+
+test();
+
+window.successfullyParsed = true;
+isSuccessfullyParsed();
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one-expected.txt b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one-expected.txt
new file mode 100644
index 0000000..da480d9
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one-expected.txt
@@ -0,0 +1,10 @@
+Test API to view origins that have local storage and to delete local storage by origin.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS layoutTestController.originsWithLocalStorage().toString() is "file__0"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one.html b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one.html
new file mode 100644
index 0000000..3a61a73
--- /dev/null
+++ b/LayoutTests/storage/domstorage/localstorage/storagetracker/storage-tracker-5-delete-one.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../../../fast/js/resources/js-test-style.css">
+<script src="../../../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../../../fast/js/resources/js-test-post-function.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("Test API to view origins that have local storage and to delete local storage by origin.");
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function finishTest() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+function test()
+{
+ if (!window.localStorage) {
+ testFailed("localStorage DOES NOT exist");
+ return;
+ }
+
+ if (layoutTestController.originsWithLocalStorage().length > 0) {
+ shouldBeEqualToString("layoutTestController.originsWithLocalStorage().toString()", "file__0");
+ // We're just going to delete the existing origin, so we'll get one origin change notification.
+ layoutTestController.observeStorageTrackerNotifications(1);
+ // At this point, we're guaranteed to have one origin with local storage.
+ layoutTestController.deleteLocalStorageForOrigin("file://");
+ } else {
+ testFailed("Ran with no origins with local storage.");
+ layoutTestController.notifyDone();
+ }
+
+}
+
+test();
+
+window.successfullyParsed = true;
+isSuccessfullyParsed();
+</script>
+</body>
+</html>