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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/securitypolicyviolation-basics.html

Issue 2331213002: Add `disposition` to SecurityPolicyViolationEvent (Closed)
Patch Set: Fix a typo in rebased test expectation Created 4 years, 2 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="/js-test-resources/js-test.js"></script> 4 <script src="/js-test-resources/js-test.js"></script>
5 <script> 5 <script>
6 description('Check that a SecurityPolicyViolationEvent handler exists, a nd that events can be created.'); 6 description('Check that a SecurityPolicyViolationEvent handler exists, a nd that events can be created.');
7 7
8 try { 8 try {
9 shouldBeEqualToString('typeof document.onsecuritypolicyviolation', ' object'); 9 shouldBeEqualToString('typeof document.onsecuritypolicyviolation', ' object');
10 shouldBeEqualToString('typeof SecurityPolicyViolationEvent', 'functi on'); 10 shouldBeEqualToString('typeof SecurityPolicyViolationEvent', 'functi on');
11 var data = { 11 var data = {
12 'documentURI': 'documentURIValue', 12 'documentURI': 'documentURIValue',
13 'referrer': 'referrerValue', 13 'referrer': 'referrerValue',
14 'blockedURI': 'blockedURIValue', 14 'blockedURI': 'blockedURIValue',
15 'violatedDirective': 'violatedDirectiveValue', 15 'violatedDirective': 'violatedDirectiveValue',
16 'effectiveDirective': 'effectiveDirectiveValue', 16 'effectiveDirective': 'effectiveDirectiveValue',
17 'originalPolicy': 'originalPolicyValue', 17 'originalPolicy': 'originalPolicyValue',
18 'disposition': 'enforce',
18 'sourceFile': 'sourceFileValue', 19 'sourceFile': 'sourceFileValue',
19 'lineNumber': 1, 20 'lineNumber': 1,
20 'columnNumber': 1, 21 'columnNumber': 1,
21 'statusCode': 200, 22 'statusCode': 200,
22 }; 23 };
23 window.e = new SecurityPolicyViolationEvent('SecurityPolicyViolation ', data); 24 window.e = new SecurityPolicyViolationEvent('SecurityPolicyViolation ', data);
24 shouldBeEqualToString('typeof window.e', 'object'); 25 shouldBeEqualToString('typeof window.e', 'object');
25 for (key in data) 26 for (key in data)
26 shouldBe('window.e.' + key, JSON.stringify(data[key])); 27 shouldBe('window.e.' + key, JSON.stringify(data[key]));
27 } catch (ex) { 28 } catch (ex) {
28 testFailed('Exception thrown: ' + ex.message); 29 testFailed('Exception thrown: ' + ex.message);
29 } 30 }
30 </script> 31 </script>
31 </head> 32 </head>
32 <body> 33 <body>
33 </body> 34 </body>
34 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698