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

Side by Side Diff: LayoutTests/http/tests/security/powerfulFeatureRestrictions/cachestorage-on-insecure-origin.html

Issue 1177983007: Cache Storage: restrict access to secure origins (Blink-side) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Simplify DevTools agent changes Created 5 years, 4 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 | Source/modules/cachestorage/CacheStorage.h » ('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>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>
OLDNEW
« no previous file with comments | « no previous file | Source/modules/cachestorage/CacheStorage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698