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

Side by Side Diff: LayoutTests/http/tests/serviceworker/http-to-https-redirect-and-register.html

Issue 1312723002: Service workers: Add test for HTTP to HTTPS redirect (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/register.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>register on a secure page arrived at via redirect from an non-secure url< /title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharness-helpers.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script src="../resources/get-host-info.js?pipe=sub"></script>
7 <script src="resources/test-helpers.js"></script>
8 <body>
9 <script>
10 // Loads a non-secure url in an frame, which redirects to a secure origin page.
11 // That page then registers a service worker, and messages back with the result.
12 // The registration should succeed.
13 promise_test(function(t) {
14 var script = 'resources/empty-worker.js';
Kunihiko Sakamoto 2015/08/24 05:57:39 nit: Unused variable.
falken 2015/08/24 06:09:02 Done.
15 var redirect_url = get_host_info()['UNAUTHENTICATED_ORIGIN'] +
16 '/serviceworker/resources/redirect.php?Redirect=';
17 var target_url = window.location.origin + '/serviceworker/resources/register .html';
18 var frame;
19
20 return with_iframe(redirect_url + encodeURIComponent(target_url))
21 .then(function(f) {
22 frame = f;
23 return new Promise(resolve => {
24 window.addEventListener('message', e => {resolve(e.data);});
25 });
26 })
27 .then(function(message) {
28 frame.remove();
29 assert_equals(message, 'PASS');
30 });
31 }, 'register on a secure page arrived at via redirect from an non-secure url') ;
32 </script>
33 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/register.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698