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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/test-helpers.js

Issue 416003003: Test for register canceling an unregister. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: more tests Created 6 years, 5 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: LayoutTests/http/tests/serviceworker/resources/test-helpers.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
index 9685b6fd6a386c28f738f179c0c2de45cfc94aca..af5509cadedfd626b1009966ca15ec314b325f64 100644
--- a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
+++ b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
@@ -63,6 +63,18 @@ function with_iframe(url, f) {
});
}
+function unload_iframe(iframe) {
+ var saw_unload = new Promise(function(resolve) {
+ iframe.contentWindow.addEventListener('unload', function() {
+ resolve();
+ });
+ });
+ iframe.src = '';
+ iframe.remove();
+ iframe = null;
+ return saw_unload;
+}
+
function normalizeURL(url) {
return new URL(url, document.location).toString().replace(/#.*$/, '');
}

Powered by Google App Engine
This is Rietveld 408576698