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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/navigation-redirect-to-http-iframe.html

Issue 2872363002: Upstream service worker navigation tests to WPT (Closed)
Patch Set: Created 3 years, 7 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/serviceworker/resources/navigation-redirect-to-http-iframe.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/navigation-redirect-to-http-iframe.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/navigation-redirect-to-http-iframe.html
deleted file mode 100644
index 234ba15e6af5674878d7a7d629ec895aeebb13ff..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/navigation-redirect-to-http-iframe.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<script src="../../resources/get-host-info.js?pipe=sub"></script>
-<script src="test-helpers.js"></script>
-<script>
-var SCOPE = './navigation-redirect-to-http.php';
-var SCRIPT = 'navigation-redirect-to-http-worker.js';
-var host_info = get_host_info();
-
-navigator.serviceWorker.getRegistration(SCOPE)
- .then(function(registration) {
- if (registration)
- return registration.unregister();
- })
- .then(function() {
- return navigator.serviceWorker.register(SCRIPT, {scope: SCOPE});
- })
- .then(function(registration) {
- return new Promise(function(resolve) {
- registration.addEventListener('updatefound', function() {
- resolve(registration.installing);
- });
- });
- })
- .then(function(worker) {
- worker.addEventListener('statechange', on_state_change);
- })
- .catch(function(reason) {
- window.parent.postMessage({results: 'FAILURE: ' + reason.message},
- host_info['HTTP_ORIGIN']);
- });
-
-function on_state_change(event) {
- if (event.target.state != 'activated')
- return;
- with_iframe(SCOPE, {auto_remove: false})
- .then(function(frame) {
- window.parent.postMessage(
- {results: frame.contentDocument.body.textContent},
- host_info['HTTP_ORIGIN']);
- });
-}
-
-</script>

Powered by Google App Engine
This is Rietveld 408576698