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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/resources/fetch-test-helpers.js

Issue 2192743002: Rewrite Fetch API referrer layout tests with service worker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 5 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/resources/fetch-test-helpers.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/resources/fetch-test-helpers.js b/third_party/WebKit/LayoutTests/http/tests/fetch/resources/fetch-test-helpers.js
index 0d8426e37cfb924d405e3c91fb5f6cfac14bb9d8..fafa39d4fbdf095c2f2c114d9a3a7c4e3b3f2c05 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/resources/fetch-test-helpers.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/resources/fetch-test-helpers.js
@@ -216,7 +216,8 @@ function testBlockMixedContent(mode) {
}, 'Block fetch() as mixed content (' + mode + ')');
}
-function add_referrer_tests(tests) {
+function add_referrer_tests(tests, global) {
+ global = global || self;
for (let test of tests) {
let url = test[0];
let referrer = test[1];
@@ -225,7 +226,7 @@ function add_referrer_tests(tests) {
promise_test(t => {
var request = new Request(url,
{referrer: referrer, referrerPolicy: policy, mode: 'cors'});
- return fetch(new Request(url, request)).then(res => {
+ return global.fetch(new Request(url, request)).then(res => {
return res.json();
}).then(json => {
assert_equals(json.referrer, expected, 'referrer');

Powered by Google App Engine
This is Rietveld 408576698