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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/request.js

Issue 2772013002: Fetch API: Fix behavior when Request constructor is passed an undefined referrer (Closed)
Patch Set: update expectation + rebase Created 3 years, 9 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
Index: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/request.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/request.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/request.js
index 107c0daaa3d5d130ddbc5c804a7d6f2f4721c2de..770b27e6cbd911d16e474da047b00c23665d1821 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/request.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/request.js
@@ -403,6 +403,19 @@ test(function() {
}, 'Request without RequestInit.');
test(function() {
+ assert_equals(new Request(URL, {referrer: undefined}).referrer,
+ 'about:client');
+ assert_equals(new Request(URL).referrerPolicy, '');
+}, 'Request with referrer equals to undefined.');
+
+test(function() {
+ var expected = location.href.slice(0, location.href.lastIndexOf('/')) +
+ '/null';
+ assert_equals(new Request(URL, {referrer: null}).referrer, expected);
+ assert_equals(new Request(URL).referrerPolicy, '');
+}, 'Request with referrer equals to null.');
+
+test(function() {
var req = new Request(URL, {referrer: 'about:client'});
assert_equals(req.referrer, 'about:client',

Powered by Google App Engine
This is Rietveld 408576698