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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/http-to-https-redirect-and-register.https.html

Issue 2911073002: Upstream service wrkr "HTTP to HTTPS" tests to WPT (Closed)
Patch Set: 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>register on a secure page after redirect from an non-secure url</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script src="/common/get-host-info.sub.js"></script>
6 <script src="resources/test-helpers.sub.js"></script>
7 <body>
8 <script>
9 'use strict';
10
11 // Loads a non-secure url in a new window, which redirects to |target_url|.
12 // That page then registers a service worker, and messages back with the result.
13 // Returns a promise that resolves with the result.
14 function redirect_and_register(target_url) {
15 var redirect_url = get_host_info()['UNAUTHENTICATED_ORIGIN'] + base_path() +
16 'resources/redirect.py?Redirect=';
17 var child = window.open(redirect_url + encodeURIComponent(target_url));
18 return new Promise(resolve => {
19 window.addEventListener('message', e => resolve(e.data));
20 })
21 .then(function(result) {
22 child.close();
23 return result;
24 });
25 }
26
27 promise_test(function(t) {
28 var target_url = window.location.origin + base_path() +
29 'resources/http-to-https-redirect-and-register-iframe.html';
30
31 return redirect_and_register(target_url)
32 .then(result => {
33 assert_equals(result, 'OK');
34 });
35 }, 'register on a secure page after redirect from an non-secure url');
36
37 promise_test(function(t) {
38 var target_url = get_host_info()['UNAUTHENTICATED_ORIGIN'] + base_path() +
39 'resources/http-to-https-redirect-and-register-iframe.html';
40
41 return redirect_and_register(target_url)
42 .then(result => {
43 assert_equals(result, 'FAIL: SecurityError');
44 });
45 }, 'register on a non-secure page after redirect from an non-secure url');
46 </script>
47 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/http-to-https-redirect-and-register-iframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698