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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-attribute-reflect.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-attribute-reflect.html b/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-attribute-reflect.html
new file mode 100644
index 0000000000000000000000000000000000000000..a51d7c1722b1cbeae910eafb02206fd744023b1c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-attribute-reflect.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+ var img = document.createElement('img');
+
+ img.referrerPolicy = '';
+ assert_equals(img.referrerPolicy, '');
+ img.setAttribute('referrerPolicy', '');
+ assert_equals(img.referrerPolicy, '');
+
+ img.referrerPolicy = 'no-referrer';
+ assert_equals(img.referrerPolicy, 'no-referrer');
+ img.setAttribute('referrerPolicy', 'no-referrer');
+ assert_equals(img.referrerPolicy, 'no-referrer');
+ img.referrerPolicy = 'NO-REFERRER';
+ assert_equals(img.referrerPolicy, 'no-referrer');
+
+ img.referrerPolicy = 'origin';
+ assert_equals(img.referrerPolicy, 'origin');
+ img.setAttribute('referrerPolicy', 'origin');
+ assert_equals(img.referrerPolicy, 'origin');
+ img.referrerPolicy = 'ORIGIN';
+ assert_equals(img.referrerPolicy, 'origin');
+
+ img.referrerPolicy = 'no-referrer-when-downgrade';
+ assert_equals(img.referrerPolicy, 'no-referrer-when-downgrade');
+ img.setAttribute('referrerPolicy', 'no-referrer-when-downgrade');
+ assert_equals(img.referrerPolicy, 'no-referrer-when-downgrade');
+ img.referrerPolicy = 'NO-REFERRER-WHEN-DOWNGRADE';
+ assert_equals(img.referrerPolicy, 'no-referrer-when-downgrade');
+
+ img.referrerPolicy = 'origin-when-cross-origin';
+ assert_equals(img.referrerPolicy, 'origin-when-cross-origin');
+ img.setAttribute('referrerPolicy', 'origin-when-cross-origin');
+ assert_equals(img.referrerPolicy, 'origin-when-cross-origin');
+ img.referrerPolicy = 'ORIGIN-when-cross-origin';
+ assert_equals(img.referrerPolicy, 'origin-when-cross-origin');
+ img.referrerPolicy = 'ORIGIN-when-cros\u017F-origin';
+ assert_equals(img.referrerPolicy, '', 'Should be ASCII-caseless.');
+
+ img.referrerPolicy = 'unsafe-url';
+ assert_equals(img.referrerPolicy, 'unsafe-url');
+ img.setAttribute('referrerPolicy', 'unsafe-url');
+ assert_equals(img.referrerPolicy, 'unsafe-url');
+ img.referrerPolicy = 'UNSAFE-URL';
+ assert_equals(img.referrerPolicy, 'unsafe-url');
+
+ img.referrerPolicy = 'foo';
+ assert_equals(img.referrerPolicy, '');
+ img.setAttribute('referrerPolicy', ' origin ');
+ assert_equals(img.referrerPolicy, '');
+}, 'refrrerPolicy IDL attribute should reflect only known values.');
+</script>
« 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