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

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

Issue 2836233002: Upstream service worker `fetch` tests to WPT (Closed)
Patch Set: Extend "-expected.txt" file with reference to new sub-test Created 3 years, 8 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/fetch-event.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https.html
index 062a41e779dfc7784d8d3c24db9ef90bc1d6ab2b..ba313c5f010b92e0584707da8f3eadf9c7f0b24c 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event.https.html
@@ -8,6 +8,35 @@
var worker = 'resources/fetch-event-test-worker.js';
async_test(function(t) {
+ const scope = 'resources/simple.html?headers';
+ service_worker_unregister_and_register(t, worker, scope)
+ .then(function(reg) {
+ return wait_for_state(t, reg.installing, 'activated');
+ })
+ .then(function() { return with_iframe(scope); })
+ .then(function(frame) {
+ t.add_cleanup(function() { frame.remove(); });
+ const headers = JSON.parse(frame.contentDocument.body.textContent);
+ const header_names = {};
+ for (const [name, value] of headers) {
+ header_names[name] = true;
+ }
+
+ assert_true(
+ header_names.hasOwnProperty('accept'),
+ 'request includes "Accept" header as inserted by Fetch'
+ );
+ assert_true(
+ header_names.hasOwnProperty('upgrade-insecure-requests'),
+ 'request specifies "Upgrade-Insecure Requests header as inserted by Fetch'
+ );
+
+ return service_worker_unregister_and_done(t, scope);
+ })
+ .catch(unreached_rejection(t));
+ }, 'Service Worker headers in the request of a fetch event');
+
+async_test(function(t) {
var scope = 'resources/simple.html?string';
service_worker_unregister_and_register(t, worker, scope)
.then(function(reg) {

Powered by Google App Engine
This is Rietveld 408576698