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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-event-respond-with-argument.html

Issue 2836233002: Upstream service worker `fetch` tests to WPT (Closed)
Patch Set: Extend "-expected.txt" file with reference to new sub-test 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Service Worker: FetchEvent.respondWith() argument type test.</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js"></script>
6 <script>
7 var resolve_test_done;
8
9 var test_done_promise = new Promise(function(resolve) {
10 resolve_test_done = resolve;
11 });
12
13 // Called by the child frame.
14 function notify_test_done(result) {
15 resolve_test_done(result);
16 }
17
18 promise_test(function(t) {
19 var scope = 'resources/fetch-event-respond-with-argument-iframe.html';
20 var script = 'resources/fetch-event-respond-with-argument-worker.js';
21 var frame;
22
23 return service_worker_unregister_and_register(t, script, scope)
24 .then(function(registration) {
25 return wait_for_state(t, registration.installing, 'activated');
26 })
27 .then(function() {
28 return with_iframe(scope);
29 })
30 .then(function(f) {
31 frame = f;
32 return test_done_promise;
33 })
34 .then(function(result) {
35 frame.remove();
36 assert_equals(result, 'PASS');
37 return service_worker_unregister_and_done(t, scope);
38 });
39 }, 'respondWith() takes either a Response or a promise that resolves ' +
40 'with a Response. Other values should raise a network error.');
41 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698