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

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

Issue 2826573004: fetch-event.https.html: Fix asserts mistakenly outside the promise chain (Closed)
Patch Set: rebase 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 8d0531ea7e6a2d42f5163291af7fcdcd36dc876f..062a41e779dfc7784d8d3c24db9ef90bc1d6ab2b 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
@@ -516,6 +516,7 @@ async_test(function(t) {
})
.catch(unreached_rejection(t));
}, 'Service Worker should expose FetchEvent URL fragments.');
+
async_test(function(t) {
var scope = 'resources/simple.html?cache';
var frame;
@@ -549,6 +550,7 @@ async_test(function(t) {
.catch(reject);
});
});
+ return Promise.all(tests);
})
.then(function() {
return new Promise(function(resolve, reject) {
@@ -639,25 +641,16 @@ async_test(function(t) {
assert_equals(
frame.contentDocument.body.textContent, '');
- return new Promise(function(resolve, reject) {
- return frame.contentWindow.fetch(scope,
- {'integrity': integrity_metadata})
- .then(function(response) {
- return response.text();
- })
- .then(function(response_text) {
- // Should get the same integrity metadata.
- assert_equals(response_text, integrity_metadata,
- 'Service Worker should respond to fetch with the correct integrity');
- })
- .then(resolve())
- .catch(reject());
- });
+ return frame.contentWindow.fetch(scope, {'integrity': integrity_metadata});
})
- .then(function() {
+ .then(response => {
+ return response.text();
+ })
+ .then(response_text => {
+ assert_equals(response_text, integrity_metadata, 'integrity');
frame.remove();
return service_worker_unregister_and_done(t, scope);
- })
+ })
.catch(unreached_rejection(t));
}, 'Service Worker responds to fetch event with the correct integrity_metadata');

Powered by Google App Engine
This is Rietveld 408576698