| 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');
|
|
|