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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/referrer/resources/serviceworker-from-origin-only-document.html

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/referrer/resources/serviceworker-from-origin-only-document.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/referrer/resources/serviceworker-from-origin-only-document.html b/third_party/WebKit/LayoutTests/http/tests/fetch/referrer/resources/serviceworker-from-origin-only-document.html
deleted file mode 100644
index 6508199c2a1dd140018af9b74156a47d509f7727..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/referrer/resources/serviceworker-from-origin-only-document.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!doctype html>
-<html>
-<meta http-equiv = "Content-Security-Policy" content = "referrer origin">
-<body>
-<script src = "/resources/testharness.js"></script>
-<script src = "/resources/testharnessreport.js"></script>
-<script src = "/serviceworker/resources/test-helpers.js"></script>
-<script src = "/fetch/resources/fetch-test-helpers.js"></script>
-<script src = "/fetch/resources/fetch-test-options.js"></script>
-<script>
-const SCRIPT = '/fetch/referrer/resources/simple-onfetch.js';
-const SCOPE = location.href;
-
-const BASE_URL = BASE_ORIGIN + '/fetch/resources/referrer.php';
-const OTHER_URL = OTHER_ORIGIN + '/fetch/resources/referrer.php';
-const REFERRER_SOURCE = location.href;
-
-promise_test(t => {
- return navigator.serviceWorker.register(SCRIPT, {scope: SCOPE}).then(r => {
- return r.ready;
- }).then(() => {
- if (navigator.serviceWorker.controller === null) {
- location.reload();
- }
- });
- });
-
-const TESTS = [
- [BASE_URL, 'about:client', '', BASE_ORIGIN + '/'],
- [BASE_URL, 'about:client', 'no-referrer', '[no-referrer]'],
- [BASE_URL, 'about:client', 'no-referrer-when-downgrade', REFERRER_SOURCE],
- [BASE_URL, 'about:client', 'origin', BASE_ORIGIN + '/'],
- [BASE_URL, 'about:client', 'origin-when-cross-origin', REFERRER_SOURCE],
- [BASE_URL, 'about:client', 'unsafe-url', REFERRER_SOURCE],
- [OTHER_URL, 'about:client', '', BASE_ORIGIN + '/'],
- [OTHER_URL, 'about:client', 'no-referrer', '[no-referrer]'],
- [OTHER_URL, 'about:client', 'no-referrer-when-downgrade', REFERRER_SOURCE],
- [OTHER_URL, 'about:client', 'origin', BASE_ORIGIN + '/'],
- [OTHER_URL, 'about:client', 'origin-when-cross-origin', BASE_ORIGIN + '/'],
- [OTHER_URL, 'about:client', 'unsafe-url', REFERRER_SOURCE],
-
- [BASE_URL, '', '', '[no-referrer]'],
- [BASE_URL, '', 'no-referrer', '[no-referrer]'],
- [BASE_URL, '', 'no-referrer-when-downgrade', '[no-referrer]'],
- [BASE_URL, '', 'origin', '[no-referrer]'],
- [BASE_URL, '', 'origin-when-cross-origin', '[no-referrer]'],
- [BASE_URL, '', 'unsafe-url', '[no-referrer]'],
- [OTHER_URL, '', '', '[no-referrer]'],
- [OTHER_URL, '', 'no-referrer', '[no-referrer]'],
- [OTHER_URL, '', 'no-referrer-when-downgrade', '[no-referrer]'],
- [OTHER_URL, '', 'origin', '[no-referrer]'],
- [OTHER_URL, '', 'origin-when-cross-origin', '[no-referrer]'],
- [OTHER_URL, '', 'unsafe-url', '[no-referrer]'],
-
- [BASE_URL, '/foo', '', BASE_ORIGIN + '/'],
- [BASE_URL, '/foo', 'no-referrer', '[no-referrer]'],
- [BASE_URL, '/foo', 'no-referrer-when-downgrade', BASE_ORIGIN + '/foo'],
- [BASE_URL, '/foo', 'origin', BASE_ORIGIN + '/'],
- [BASE_URL, '/foo', 'origin-when-cross-origin', BASE_ORIGIN + '/foo'],
- [BASE_URL, '/foo', 'unsafe-url', BASE_ORIGIN + '/foo'],
- [OTHER_URL, '/foo', '', BASE_ORIGIN + '/'],
- [OTHER_URL, '/foo', 'no-referrer', '[no-referrer]'],
- [OTHER_URL, '/foo', 'no-referrer-when-downgrade', BASE_ORIGIN + '/foo'],
- [OTHER_URL, '/foo', 'origin', BASE_ORIGIN + '/'],
- [OTHER_URL, '/foo', 'origin-when-cross-origin', BASE_ORIGIN + '/'],
- [OTHER_URL, '/foo', 'unsafe-url', BASE_ORIGIN + '/foo'],
-];
-
-add_referrer_tests(TESTS);
-done();
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698