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

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: Addressing Comments: changing TreatAsNull, adding frameOwnerPropertyChanged 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLAttributeNames.in » ('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 <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_true('csp' in i);
13 assert_equals('string', typeof (i.csp));
Mike West 2016/09/27 07:54:21 Nit: I don't think you need `()` here.
14 }, "<iframe> has a 'csp' attibute which is an empty string if undefined.") ;
15
16 test(t => {
17 var i = document.createElement('iframe');
18 i.setAttribute('csp', 123456);
19 assert_equals('123456', i.csp);
20 }, "<iframe>'s csp attribute is always a string.");
21
22 test(t => {
23 var i = document.createElement('iframe');
24 i.csp = 'value';
25 assert_equals('value', i.getAttribute('csp'));
26 }, "<iframe>'s 'csp' content attribute reflects the IDL attribute.");
27
28 test(t => {
29 var i = document.createElement('iframe');
30
Mike West 2016/09/27 07:54:22 Nit: You don't have this newline in any other test
31 i.setAttribute('csp', 'value');
32 assert_equals('value', i.csp);
33 }, "<iframe>'s IDL attribute reflects the DOM attribute.");
34 </script>
35 </body>
36 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLAttributeNames.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698