OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Cache Storage On An Insecure Origin</title> |
| 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <script src="/resources/get-host-info.js"></script> |
| 6 <script> |
| 7 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { |
| 8 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p
athname; |
| 9 } else { |
| 10 if (window.testRunner) |
| 11 testRunner.overridePreference("WebKitStrictPowerfulFeatureRestrictions",
true); |
| 12 |
| 13 promise_test(function(test) { |
| 14 return window.caches.match('http://example.com/resource.html') |
| 15 .then( |
| 16 test.unreached_func('promise should not be fulfilled'), |
| 17 function(reason) { |
| 18 assert_equals(reason.name, 'SecurityError', |
| 19 'match should reject with SecurityError'); |
| 20 }); |
| 21 }, 'CacheStorage match() on insecure origin'); |
| 22 |
| 23 promise_test(function(test) { |
| 24 return window.caches.has('name') |
| 25 .then( |
| 26 test.unreached_func('promise should not be fulfilled'), |
| 27 function(reason) { |
| 28 assert_equals(reason.name, 'SecurityError', |
| 29 'match should reject with SecurityError'); |
| 30 }); |
| 31 }, 'CacheStorage has() on insecure origin'); |
| 32 |
| 33 promise_test(function(test) { |
| 34 return window.caches.open('name') |
| 35 .then( |
| 36 test.unreached_func('promise should not be fulfilled'), |
| 37 function(reason) { |
| 38 assert_equals(reason.name, 'SecurityError', |
| 39 'match should reject with SecurityError'); |
| 40 }); |
| 41 }, 'CacheStorage open() on insecure origin'); |
| 42 |
| 43 promise_test(function(test) { |
| 44 return window.caches.delete('name') |
| 45 .then( |
| 46 test.unreached_func('promise should not be fulfilled'), |
| 47 function(reason) { |
| 48 assert_equals(reason.name, 'SecurityError', |
| 49 'match should reject with SecurityError'); |
| 50 }); |
| 51 }, 'CacheStorage delete() on insecure origin'); |
| 52 |
| 53 promise_test(function(test) { |
| 54 return window.caches.keys() |
| 55 .then( |
| 56 test.unreached_func('promise should not be fulfilled'), |
| 57 function(reason) { |
| 58 assert_equals(reason.name, 'SecurityError', |
| 59 'match should reject with SecurityError'); |
| 60 }); |
| 61 }, 'CacheStorage keys() on insecure origin'); |
| 62 } |
| 63 </script> |
OLD | NEW |