Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(966)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-force-update-on-page-load.html

Issue 2207163002: [DevTools] Removed InspectorTest.invokePageFunctionPromise (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.");

Powered by Google App Engine
This is Rietveld 408576698