| Index: third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html
|
| index 603c6035d0f8cbceef5df5d9558ba7f404685da3..444bdc74dadabc56b56a26bd490053889c727d1a 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html
|
| @@ -5,12 +5,15 @@
|
| <script src="../resources-test.js"></script>
|
| <script>
|
|
|
| -function loadIframe(resolve, reject, url)
|
| +function loadIframe(url)
|
| {
|
| + var callback;
|
| + var promise = new Promise((fulfill) => callback = fulfill);
|
| var frame = document.createElement('iframe');
|
| frame.src = url;
|
| - frame.onload = resolve;
|
| + frame.onload = callback;
|
| document.body.appendChild(frame);
|
| + return promise;
|
| }
|
|
|
| function test()
|
| @@ -51,32 +54,30 @@ function test()
|
| }
|
| installNewWorkerDetector(scope);
|
| WebInspector.inspectorView.showPanel("sources")
|
| - .then(function(){
|
| - return waitForWorkerActivated(scope);
|
| - })
|
| + .then(() => waitForWorkerActivated(scope))
|
| .then(function(){
|
| InspectorTest.addResult("The first ServiceWorker is activated.");
|
| - return InspectorTest.invokePageFunctionPromise("loadIframe", [scope])
|
| + return InspectorTest.callFunctionInPageAsync("loadIframe", [ scope ]);
|
| })
|
| .then(function() {
|
| InspectorTest.addResult("The first frame loaded.");
|
| - return InspectorTest.invokePageFunctionPromise("loadIframe", [scope]);
|
| + return InspectorTest.callFunctionInPageAsync("loadIframe", [ scope ]);
|
| })
|
| .then(function() {
|
| InspectorTest.addResult("The second frame loaded.");
|
| InspectorTest.addResult("Check \"Force update on page load\" check box");
|
| WebInspector.settings.settingForTest("serviceWorkerUpdateOnReload").set(true);
|
| - return InspectorTest.invokePageFunctionPromise("loadIframe", [scope]);
|
| + return InspectorTest.callFunctionInPageAsync("loadIframe", [ scope ]);
|
| })
|
| .then(function() {
|
| InspectorTest.addResult("The third frame loaded. The second worker must be activated before here.");
|
| - return InspectorTest.invokePageFunctionPromise("loadIframe", [scope]);
|
| + return InspectorTest.callFunctionInPageAsync("loadIframe", [ scope ]);
|
| })
|
| .then(function() {
|
| InspectorTest.addResult("The fourth frame loaded. The third worker must be activated before here.");
|
| InspectorTest.addResult("Uncheck \"Force update on page load\" check box");
|
| WebInspector.settings.settingForTest("serviceWorkerUpdateOnReload").set(false);
|
| - return InspectorTest.invokePageFunctionPromise("loadIframe", [scope]);
|
| + return InspectorTest.callFunctionInPageAsync("loadIframe", [ scope ]);
|
| })
|
| .then(function() {
|
| InspectorTest.addResult("The fifth frame loaded.");
|
|
|