diff options
author | Steve Block <steveblock@google.com> | 2010-04-27 16:31:00 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-11 14:42:12 +0100 |
commit | dcc8cf2e65d1aa555cce12431a16547e66b469ee (patch) | |
tree | 92a8d65cd5383bca9749f5327fb5e440563926e6 /LayoutTests/http/tests | |
parent | ccac38a6b48843126402088a309597e682f40fe6 (diff) | |
download | external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2 |
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'LayoutTests/http/tests')
6 files changed, 73 insertions, 15 deletions
diff --git a/LayoutTests/http/tests/appcache/top-frame-2-expected.txt b/LayoutTests/http/tests/appcache/top-frame-2-expected.txt index 6e99bb6..41a3fe0 100644 --- a/LayoutTests/http/tests/appcache/top-frame-2-expected.txt +++ b/LayoutTests/http/tests/appcache/top-frame-2-expected.txt @@ -2,6 +2,5 @@ Test that a subframe without manifest gets picked by a relevant application cach Should say SUCCESS: -checking SUCCESS diff --git a/LayoutTests/http/tests/appcache/top-frame-2.html b/LayoutTests/http/tests/appcache/top-frame-2.html index c239d08..71bd468 100644 --- a/LayoutTests/http/tests/appcache/top-frame-2.html +++ b/LayoutTests/http/tests/appcache/top-frame-2.html @@ -16,13 +16,34 @@ function log(message) document.getElementById("result").innerHTML += message + "<br>"; } +function debug(message) +{ + // If running manually in the browser, print the sequence of events. + if (!window.layoutTestController) + log(message); +} + +var receivedExpectedMessage = false; +var receivedCheckingEvent = false; +var receivedNoupdateEvent = false; + +function checkDone() +{ + if (receivedExpectedMessage && receivedCheckingEvent && receivedNoupdateEvent) { + log("SUCCESS"); + if (window.layoutTestController) + layoutTestController.notifyDone(); + } +} + function test() { applicationCache.onnoupdate = null; applicationCache.oncached = null; // When a new main resource is associated with the cache, an update should be started. - applicationCache.onchecking = function() { log("checking") } + applicationCache.onchecking = function() { debug("checking"); receivedCheckingEvent = true; checkDone(); } + applicationCache.onnoupdate = function() { debug("noupdate"); receivedNoupdateEvent = true; checkDone(); } var ifr = document.createElement("iframe"); ifr.setAttribute("src", "resources/subframe-2.html"); @@ -35,7 +56,7 @@ applicationCache.oncached = function() { test() } applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") } applicationCache.onerror = function() { log("FAIL: received unexpected error event") } -window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false); +window.addEventListener("message", function() { debug("message"); receivedExpectedMessage = true; checkDone(); }, false); </script> </body> diff --git a/LayoutTests/http/tests/appcache/top-frame-3-expected.txt b/LayoutTests/http/tests/appcache/top-frame-3-expected.txt index a10dbee..a1245cb 100644 --- a/LayoutTests/http/tests/appcache/top-frame-3-expected.txt +++ b/LayoutTests/http/tests/appcache/top-frame-3-expected.txt @@ -4,7 +4,5 @@ In this case, the subframe resource is NOT listed in manifest explicitly. Should say SUCCESS: -checking -checking SUCCESS diff --git a/LayoutTests/http/tests/appcache/top-frame-3.html b/LayoutTests/http/tests/appcache/top-frame-3.html index 9fc9dde..a2d2cc6 100644 --- a/LayoutTests/http/tests/appcache/top-frame-3.html +++ b/LayoutTests/http/tests/appcache/top-frame-3.html @@ -16,13 +16,34 @@ function log(message) document.getElementById("result").innerHTML += message + "<br>"; } +function debug(message) +{ + // If running manually in the browser, print the sequence of events. + if (!window.layoutTestController) + log(message); +} + +var receivedExpectedMessage = false; +var receivedCheckingEventsCounter = 0; +var receivedNoupdateEventsCounter = 0; + +function checkDone() +{ + if (receivedExpectedMessage && receivedCheckingEventsCounter == 2 && receivedNoupdateEventsCounter == 2) { + log("SUCCESS"); + if (window.layoutTestController) + layoutTestController.notifyDone(); + } +} + function test() { applicationCache.onnoupdate = null; applicationCache.oncached = null; // When a new main resource is associated with the cache, an update should be started. - applicationCache.onchecking = function() { log("checking") } + applicationCache.onchecking = function() { debug("checking"); receivedCheckingEventsCounter++; checkDone() } + applicationCache.onnoupdate = function() { debug("noupdate"); receivedNoupdateEventsCounter++; checkDone(); } var ifr = document.createElement("iframe"); ifr.setAttribute("src", "resources/subframe-3.html"); @@ -42,9 +63,9 @@ function test2() function test3() { - log("SUCCESS"); - if (window.layoutTestController) - layoutTestController.notifyDone(); + debug("message"); + receivedExpectedMessage = true; + checkDone(); } applicationCache.onnoupdate = function() { test() } diff --git a/LayoutTests/http/tests/appcache/top-frame-4-expected.txt b/LayoutTests/http/tests/appcache/top-frame-4-expected.txt index 43bfd43..e748160 100644 --- a/LayoutTests/http/tests/appcache/top-frame-4-expected.txt +++ b/LayoutTests/http/tests/appcache/top-frame-4-expected.txt @@ -4,7 +4,5 @@ In this case, the subframe resource is listed in manifest explicitly. Should say SUCCESS: -checking -checking SUCCESS diff --git a/LayoutTests/http/tests/appcache/top-frame-4.html b/LayoutTests/http/tests/appcache/top-frame-4.html index 39743b9..c36e0a3 100644 --- a/LayoutTests/http/tests/appcache/top-frame-4.html +++ b/LayoutTests/http/tests/appcache/top-frame-4.html @@ -16,13 +16,34 @@ function log(message) document.getElementById("result").innerHTML += message + "<br>"; } +function debug(message) +{ + // If running manually in the browser, print the sequence of events. + if (!window.layoutTestController) + log(message); +} + +var receivedExpectedMessage = false; +var receivedCheckingEventsCounter = 0; +var receivedNoupdateEventsCounter = 0; + +function checkDone() +{ + if (receivedExpectedMessage && receivedCheckingEventsCounter == 2 && receivedNoupdateEventsCounter == 2) { + log("SUCCESS"); + if (window.layoutTestController) + layoutTestController.notifyDone(); + } +} + function test() { applicationCache.onnoupdate = null; applicationCache.oncached = null; // When a new main resource is associated with the cache, an update should be started. - applicationCache.onchecking = function() { log("checking") } + applicationCache.onchecking = function() { debug("checking"); receivedCheckingEventsCounter++; checkDone() } + applicationCache.onnoupdate = function() { debug("noupdate"); receivedNoupdateEventsCounter++; checkDone(); } var ifr = document.createElement("iframe"); ifr.setAttribute("src", "resources/subframe-4.html"); @@ -42,9 +63,9 @@ function test2() function test3() { - log("SUCCESS"); - if (window.layoutTestController) - layoutTestController.notifyDone(); + debug("message"); + receivedExpectedMessage = true; + checkDone(); } applicationCache.onnoupdate = function() { test() } |