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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-attribute-reflect.html

Issue 2397093002: IDL compiler should generate equalIgnoringASCIICase() for ReflectOnly. (Closed)
Patch Set: 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/bindings/templates/attributes.cpp.tmpl » ('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 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <script>
5 test(() => {
6 var img = document.createElement('img');
7
8 img.referrerPolicy = '';
9 assert_equals(img.referrerPolicy, '');
10 img.setAttribute('referrerPolicy', '');
11 assert_equals(img.referrerPolicy, '');
12
13 img.referrerPolicy = 'no-referrer';
14 assert_equals(img.referrerPolicy, 'no-referrer');
15 img.setAttribute('referrerPolicy', 'no-referrer');
16 assert_equals(img.referrerPolicy, 'no-referrer');
17 img.referrerPolicy = 'NO-REFERRER';
18 assert_equals(img.referrerPolicy, 'no-referrer');
19
20 img.referrerPolicy = 'origin';
21 assert_equals(img.referrerPolicy, 'origin');
22 img.setAttribute('referrerPolicy', 'origin');
23 assert_equals(img.referrerPolicy, 'origin');
24 img.referrerPolicy = 'ORIGIN';
25 assert_equals(img.referrerPolicy, 'origin');
26
27 img.referrerPolicy = 'no-referrer-when-downgrade';
28 assert_equals(img.referrerPolicy, 'no-referrer-when-downgrade');
29 img.setAttribute('referrerPolicy', 'no-referrer-when-downgrade');
30 assert_equals(img.referrerPolicy, 'no-referrer-when-downgrade');
31 img.referrerPolicy = 'NO-REFERRER-WHEN-DOWNGRADE';
32 assert_equals(img.referrerPolicy, 'no-referrer-when-downgrade');
33
34 img.referrerPolicy = 'origin-when-cross-origin';
35 assert_equals(img.referrerPolicy, 'origin-when-cross-origin');
36 img.setAttribute('referrerPolicy', 'origin-when-cross-origin');
37 assert_equals(img.referrerPolicy, 'origin-when-cross-origin');
38 img.referrerPolicy = 'ORIGIN-when-cross-origin';
39 assert_equals(img.referrerPolicy, 'origin-when-cross-origin');
40 img.referrerPolicy = 'ORIGIN-when-cros\u017F-origin';
41 assert_equals(img.referrerPolicy, '', 'Should be ASCII-caseless.');
42
43 img.referrerPolicy = 'unsafe-url';
44 assert_equals(img.referrerPolicy, 'unsafe-url');
45 img.setAttribute('referrerPolicy', 'unsafe-url');
46 assert_equals(img.referrerPolicy, 'unsafe-url');
47 img.referrerPolicy = 'UNSAFE-URL';
48 assert_equals(img.referrerPolicy, 'unsafe-url');
49
50 img.referrerPolicy = 'foo';
51 assert_equals(img.referrerPolicy, '');
52 img.setAttribute('referrerPolicy', ' origin ');
53 assert_equals(img.referrerPolicy, '');
54 }, 'refrrerPolicy IDL attribute should reflect only known values.');
55 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698