| Index: third_party/WebKit/LayoutTests/http/tests/appcache/main-resource-redirect.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/appcache/main-resource-redirect.html b/third_party/WebKit/LayoutTests/http/tests/appcache/main-resource-redirect.html
|
| index 0fa3d214ffc50d8229300c9d69f138390842b825..4989fdc957ca1efa3e9c1cf2db236cebb032ef78 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/appcache/main-resource-redirect.html
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/appcache/main-resource-redirect.html
|
| @@ -8,21 +8,23 @@ if (window.testRunner) {
|
| testRunner.dumpAsText();
|
| }
|
|
|
| -function setNetworkEnabled(state)
|
| +function setNetworkEnabled(state, callback)
|
| {
|
| var req = new XMLHttpRequest;
|
| - req.open("GET", "/resources/network-simulator.php?command=" + (state ? "connect" : "disconnect"), false);
|
| + req.open("GET", "/resources/network-simulator.php?command=" + (state ? "connect" : "disconnect"));
|
| req.send("");
|
| + req.onload = callback;
|
| }
|
|
|
| function test()
|
| {
|
| applicationCache.oncached = null;
|
| applicationCache.onnoupdate = null;
|
| - setNetworkEnabled(false);
|
| - var ifr = document.createElement("iframe");
|
| - ifr.setAttribute("src", "resources/main-resource-redirect-frame.php");
|
| - document.body.appendChild(ifr);
|
| + setNetworkEnabled(false, () => {
|
| + var ifr = document.createElement("iframe");
|
| + ifr.setAttribute("src", "resources/main-resource-redirect-frame.php");
|
| + document.body.appendChild(ifr);
|
| + });
|
| }
|
|
|
| function done()
|
| @@ -36,6 +38,6 @@ function done()
|
|
|
| applicationCache.oncached=test;
|
| applicationCache.onnoupdate=test;
|
| -applicationCache.onerror = function() { setNetworkEnabled(true); window.location.reload(); }
|
| +applicationCache.onerror = function() { setNetworkEnabled(true, () => { window.location.reload(); }); };
|
| </script>
|
| </body>
|
|
|