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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/foreign-fetch-cors.https.html

Issue 2676733002: Upstream foreign fetch tests. (Closed)
Patch Set: rebase Created 3 years, 10 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/external/wpt/service-workers/service-worker/foreign-fetch-cors.https.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-cors.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/foreign-fetch-cors.https.html
similarity index 92%
rename from third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-cors.html
rename to third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/foreign-fetch-cors.https.html
index c2cbc19b2890e2b0e88abb45ea19346ccb1a2d67..d4d728b1ef675f4e1718c8329fd976ba5d697910 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-cors.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/foreign-fetch-cors.https.html
@@ -1,8 +1,9 @@
<!DOCTYPE html>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="../resources/get-host-info.js"></script>
-<script src="resources/test-helpers.js"></script>
+<title>Service Worker: Foreign Fetch CORS functionality</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/get-host-info.sub.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
<script src="resources/foreign-fetch-helpers.js"></script>
<body>
<script>
@@ -12,7 +13,7 @@ var wrong_origin = 'https://example.com/';
var test_header = 'X-ServiceWorker-ServerHeader';
function url_to_fetch(scope) {
- return host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope;
+ return host_info.HTTPS_REMOTE_ORIGIN + new URL('resources/', location).pathname + scope;
}
function worker_for_response(response) {
@@ -76,7 +77,8 @@ function verify_cors_fetch_with_header_value(url, header_value) {
return r.text();
})
.then(response_text => {
- assert_true(response_text.startsWith('report('));
+ assert_true(response_text.startsWith('report('),
+ 'Correct content via fetch');
return self.caches.open(url);
})
.then(c => {
@@ -90,7 +92,8 @@ function verify_cors_fetch_with_header_value(url, header_value) {
return r.text();
})
.then(response_text => {
- assert_true(response_text.startsWith('report('));
+ assert_true(response_text.startsWith('report('),
+ 'Correct content via cache');
return self.caches.delete(url);
})
.then(() => new Promise(resolve => {
@@ -102,7 +105,8 @@ function verify_cors_fetch_with_header_value(url, header_value) {
request.send();
}))
.then(xhr => {
- assert_true(xhr.responseText.startsWith('report('));
+ assert_true(xhr.responseText.startsWith('report('),
+ 'Correct content via xhr');
assert_equals(xhr.getResponseHeader(test_header), header_value);
var headers = xhr.getAllResponseHeaders().toLowerCase();
if (header_value) {

Powered by Google App Engine
This is Rietveld 408576698