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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/request-headers.html

Issue 2735443002: Refactor ServiceWorker tests for inclusion in WPT (Closed)
Patch Set: Upstream service worker nav. preload tests to WPT Created 3 years, 9 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 <meta charset="utf-8">
3 <title>Navigation Preload request headers</title>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../resources/test-helpers.js"></script>
7 <script>
8 promise_test(t => {
9 var script = 'resources/request-headers-worker.js';
10 var scope = 'resources/request-headers-scope.php';
11 return service_worker_unregister_and_register(t, script, scope)
12 .then(registration => {
13 add_completion_callback(_ => registration.unregister());
14 var worker = registration.installing;
15 return wait_for_state(t, worker, 'activated');
16 })
17 .then(_ => with_iframe(scope))
18 .then(frame => {
19 var headers = JSON.parse(frame.contentDocument.body.textContent);
20 assert_equals(
21 headers['HTTP_SERVICE_WORKER_NAVIGATION_PRELOAD'],
22 'hello',
23 'The header of Navigation Preload request must have correct ' +
24 '"Service-Worker-Navigation-Preload" header.');
25 assert_equals(
26 headers['HTTP_UPGRADE_INSECURE_REQUESTS'],
27 '1',
28 'The header of Navigation Preload request must have ' +
29 '"Upgrade-Insecure-Requests" header.');
30 });
31 }, 'Navigation Preload request headers.');
32
33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698