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

Unified Diff: LayoutTests/http/tests/serviceworker/fetch-event.html

Issue 318393002: Initial implementation of ServiceWorkerGlobalScope.fetch() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incoroporated dominicc's comment Created 6 years, 6 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/fetch-event.html
diff --git a/LayoutTests/http/tests/serviceworker/fetch-event.html b/LayoutTests/http/tests/serviceworker/fetch-event.html
index e5b9735f16e7dc8d614bc0c4c3a56c62bf8d3065..a61d2965b5b44e0f087ddba634ee5abd2f39b875 100644
--- a/LayoutTests/http/tests/serviceworker/fetch-event.html
+++ b/LayoutTests/http/tests/serviceworker/fetch-event.html
@@ -85,5 +85,25 @@ var worker = 'resources/fetch-event-test-worker.js';
}));
}
}());
+
+(function() {
+ var t = async_test('Service Worker fetches other file in fetch event');
+ var scope = 'resources/simple.html?fetch';
+ service_worker_unregister_and_register(t, worker, scope, onRegister);
+
+ function onRegister(sw) {
+ sw.addEventListener('statechange', t.step_func(onStateChange));
+ }
+
+ function onStateChange(event) {
+ if (event.target.state != 'active')
+ return;
+ with_iframe(scope, t.step_func(function(frame) {
+ assert_equals(frame.contentDocument.body.textContent, 'Here\'s an other html file.\n',
+ 'Response should come from fetched other file');
+ service_worker_unregister_and_done(t, scope);
+ }));
+ }
+}());
</script>
</body>
« no previous file with comments | « LayoutTests/http/tests/serviceworker/fetch.html ('k') | LayoutTests/http/tests/serviceworker/fetch-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698