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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/iframe-csp-attribute.html

Issue 2370783002: Adding CSP attribute on HTMLIFrameElement (Closed)
Patch Set: Adding formatting to the test file 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <script>
9 test(t => {
10 var i = document.createElement('iframe');
11 assert_equals('', i.csp);
12 assert_equals('string', typeof (i.csp));
Mike West 2016/09/26 14:55:02 Nit: Can you add `assert_true('csp' in i)`?
13 }, "<iframe> has a 'csp' attibute which is an empty string if undefined.") ;
14
15 test(t => {
16 var i = document.createElement('iframe');
17 i.setAttribute('csp', 123456);
18 assert_equals('123456', i.csp);
19 }, "<iframe>'s csp attribute is always a string.");
20
21 test(t => {
22 var i = document.createElement('iframe');
23 i.csp = 'value';
24 assert_equals('value', i.getAttribute('csp'));
25 }, "<iframe> has a 'csp' attibute.");
Mike West 2016/09/26 14:55:02 Nit: Perhaps "<iframe>'s 'csp' content attribute r
26
27 test(t => {
28 var first_iframe = document.createElement('iframe');
29 var second_iframe = document.createElement('iframe');
30
31 first_iframe.setAttribute('csp', 'value 1');
32 assert_equals('value 1', first_iframe.csp);
33
34 second_iframe.setAttribute('csp', 'value 2');
35 assert_equals('value 2', second_iframe.csp);
36 }, "'csp' attribute of <iframe> has proper value.");
Mike West 2016/09/26 14:55:02 Nit: Perhaps "<iframe>'s IDL attribute reflects th
37 </script>
38 </body>
39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698