OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Cache Storage: Verify access in sandboxed iframes</title> | 2 <title>Cache Storage: Verify access in sandboxed iframes</title> |
3 <link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storage"> | 3 <link rel="help" href="https://w3c.github.io/ServiceWorker/#cache-storage"> |
4 <meta name="timeout" content="long"> | 4 <meta name="timeout" content="long"> |
5 <script src="/resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
6 <script src="/resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
7 <script src="../resources/testharness-helpers.js"></script> | |
8 <script> | 7 <script> |
9 | 8 |
10 function load_iframe(src, sandbox) { | 9 function load_iframe(src, sandbox) { |
11 return new Promise(function(resolve, reject) { | 10 return new Promise(function(resolve, reject) { |
12 var iframe = document.createElement('iframe'); | 11 var iframe = document.createElement('iframe'); |
13 iframe.onload = function() { resolve(iframe); }; | 12 iframe.onload = function() { resolve(iframe); }; |
14 | 13 |
15 iframe.sandbox = sandbox; | 14 iframe.sandbox = sandbox; |
16 iframe.src = src; | 15 iframe.src = src; |
17 | 16 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 .then(function(message) { | 57 .then(function(message) { |
59 assert_equals( | 58 assert_equals( |
60 message.result, 'denied', | 59 message.result, 'denied', |
61 'Access should be denied if sandbox lacks allow-same-origin'); | 60 'Access should be denied if sandbox lacks allow-same-origin'); |
62 assert_equals(message.name, 'SecurityError', | 61 assert_equals(message.name, 'SecurityError', |
63 'Failure should be a SecurityError'); | 62 'Failure should be a SecurityError'); |
64 }); | 63 }); |
65 }, 'Sandboxed iframe without allow-same-origin is denied access'); | 64 }, 'Sandboxed iframe without allow-same-origin is denied access'); |
66 | 65 |
67 </script> | 66 </script> |
OLD | NEW |