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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-request-xhr-sync.https.html

Issue 2907443002: Upstream service worker "XHR" test to WPT (Closed)
Patch Set: Incorporate review feedback Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Service Worker: Synchronous XHR is intercepted</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.sub.js"></script>
6 <script>
7 'use strict';
8
9 promise_test(function(t) {
10 var url = 'resources/fetch-request-xhr-sync-worker.js';
falken 2017/05/31 01:39:33 Suggest comment: // The |scope| file does not exis
mike3 2017/05/31 16:12:11 That file *does* exist; it's the file requested fr
11 var scope = 'resources/fetch-request-xhr-sync-iframe.html';
12
13 return service_worker_unregister_and_register(t, url, scope)
14 .then(function(registration) {
15 t.add_cleanup(function() {
16 registration.unregister();
17 });
18
19 return wait_for_state(t, registration.installing, 'activated');
20 })
21 .then(function() { return with_iframe(scope); })
22 .then(function(frame) {
23 t.add_cleanup(function() {
24 frame.remove();
25 });
26
27 return new Promise(function(resolve, reject) {
28 setTimeout(function() {
29 try {
30 assert_equals(
31 frame.contentWindow.performSyncXHR(),
32 200,
33 'HTTP response status code for intercepted request'
34 );
falken 2017/05/31 01:39:33 Adding an assert for the body text should be fine
mike3 2017/05/31 16:12:11 Acknowledged.
35 resolve();
36 } catch (err) {
37 reject(err);
38 }
39 }, 0);
40 });
41 });
42 }, 'Verify SyncXHR is intercepted');
43 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-request-xhr-sync.https-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698