diff options
Diffstat (limited to 'testing/web-platform/tests/service-workers/service-worker')
3 files changed, 13 insertions, 3 deletions
diff --git a/testing/web-platform/tests/service-workers/service-worker/fetch-frame-resource.https.html b/testing/web-platform/tests/service-workers/service-worker/fetch-frame-resource.https.html index cc1dac472..fd7419832 100644 --- a/testing/web-platform/tests/service-workers/service-worker/fetch-frame-resource.https.html +++ b/testing/web-platform/tests/service-workers/service-worker/fetch-frame-resource.https.html @@ -110,7 +110,8 @@ async_test(function(t) { frame.src = scope + '?mode=cors&url=' + encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + path + - '?ACAOrigin=' + host_info['HTTPS_ORIGIN']); + '?ACAOrigin=' + host_info['HTTPS_ORIGIN'] + + '&ACACredentials=true'); document.body.appendChild(frame); return getLoadedFrameAsObject(frame); }) @@ -183,7 +184,8 @@ async_test(function(t) { var win = window.open( scope + '?mode=cors&url=' + encodeURIComponent(host_info['HTTPS_REMOTE_ORIGIN'] + path + - '?ACAOrigin=' + host_info['HTTPS_ORIGIN'])); + '?ACAOrigin=' + host_info['HTTPS_ORIGIN'] + + '&ACACredentials=true')); return getLoadedWindowAsObject(win); }) .then(function(result) { diff --git a/testing/web-platform/tests/service-workers/service-worker/resource-timing.https.html b/testing/web-platform/tests/service-workers/service-worker/resource-timing.https.html index f33c41d71..3a1adfa48 100644 --- a/testing/web-platform/tests/service-workers/service-worker/resource-timing.https.html +++ b/testing/web-platform/tests/service-workers/service-worker/resource-timing.https.html @@ -13,6 +13,10 @@ function verify(performance, resource, description) { assert_greater_than(entry.workerStart, 0, description); assert_greater_than_equal(entry.workerStart, entry.startTime, description); assert_less_than_equal(entry.workerStart, entry.fetchStart, description); + assert_greater_than_equal(entry.responseStart, entry.fetchStart, description); + assert_greater_than_equal(entry.responseEnd, entry.responseStart, description); + assert_greater_than(entry.responseEnd, entry.fetchStart, description); + assert_greater_than(entry.duration, 0, description); if (resource.indexOf('redirect.py') != -1) { assert_less_than_equal(entry.workerStart, entry.redirectStart, description); diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/resource-timing-worker.js b/testing/web-platform/tests/service-workers/service-worker/resources/resource-timing-worker.js index 481a6536a..452876838 100644 --- a/testing/web-platform/tests/service-workers/service-worker/resources/resource-timing-worker.js +++ b/testing/web-platform/tests/service-workers/service-worker/resources/resource-timing-worker.js @@ -1,5 +1,9 @@ self.addEventListener('fetch', function(event) { if (event.request.url.indexOf('dummy.js') != -1) { - event.respondWith(new Response()); + event.respondWith(new Promise(resolve => { + // Slightly delay the response so we ensure we get a non-zero + // duration. + setTimeout(_ => resolve(new Response()), 100); + })); } }); |