| Index: third_party/WebKit/LayoutTests/http/tests/appcache/obsolete-error-events.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/appcache/obsolete-error-events.html b/third_party/WebKit/LayoutTests/http/tests/appcache/obsolete-error-events.html
|
| index 62571d7a8cdf60b6735c1187eee781b752d3ac87..4f5f21c3ab9d3f574fe436ae10243d9dc1979342 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/appcache/obsolete-error-events.html
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/appcache/obsolete-error-events.html
|
| @@ -4,11 +4,12 @@
|
| var jsTestIsAsync = true;
|
| description("Test that master list entries receive errors when manifest becomes obsolete.");
|
|
|
| -function setManifestState(state)
|
| +function setManifestState(state, callback)
|
| {
|
| var req = new XMLHttpRequest;
|
| - req.open("GET", "resources/fail-on-update.php?command=" + (state), false);
|
| + req.open("GET", "resources/fail-on-update.php?command=" + (state));
|
| req.send(null);
|
| + req.onload = callback;
|
| }
|
|
|
| var eventDetailsFromFrame = null;
|
| @@ -43,15 +44,15 @@ function test()
|
| applicationCache.onnoupdate = function() { testFailed("Unexpected noupdate event") }
|
| applicationCache.oncached = function() { testFailed("Unexpected cached event") }
|
|
|
| - setManifestState('delete');
|
| + setManifestState('delete', () => {
|
| + // The frame will be associated to a cache, but update will obsolete it.
|
| + var ifr = document.createElement("iframe");
|
| + ifr.setAttribute("src", "resources/obsolete-error-events-frame.html");
|
| + document.body.appendChild(ifr);
|
|
|
| - // The frame will be associated to a cache, but update will obsolete it.
|
| - var ifr = document.createElement("iframe");
|
| - ifr.setAttribute("src", "resources/obsolete-error-events-frame.html");
|
| - document.body.appendChild(ifr);
|
| -
|
| - applicationCache.onobsolete = onObsolete;
|
| - window.onmessage = onMessage;
|
| + applicationCache.onobsolete = onObsolete;
|
| + window.onmessage = onMessage;
|
| + });
|
| }
|
|
|
| function resetManifest()
|
| @@ -61,11 +62,12 @@ function resetManifest()
|
| return;
|
| }
|
|
|
| - setManifestState('reset');
|
| - location.reload();
|
| + setManifestState('reset', () => {
|
| + location.reload();
|
| + });
|
| }
|
|
|
| -applicationCache.oncached = function() {
|
| +applicationCache.onnoupdate = applicationCache.oncached = function() {
|
| clearTimeout(timeoutId);
|
| test();
|
| };
|
| @@ -73,6 +75,7 @@ applicationCache.oncached = function() {
|
| // If the manifest script happened to be in a wrong state, reset it.
|
| var timeoutId = setTimeout(resetManifest, 100);
|
|
|
| +setTimeout(finishJSTest, 2000);
|
| </script>
|
| </body>
|
| </html>
|
|
|