gecko-dev/testing/web-platform/tests/background-fetch/service_workers
Mugdha Lakhani 3a790c499d Bug 1507325 [wpt PR 14060] - Add a list of BackgroundFetchRecord objects to BackgroundFetchRegistration., a=testonly
Automatic update from web-platform-testsAdd a list of BackgroundFetchRecord objects to BackgroundFetchRegistration.

When we allow access to active background fetches, BackgroundFetchRecords for
the fetch can be accessed from multiple places. It simplifies matters if
we return the same record for a request whenever it's accessed.

This CL adds a (private) list of BackgroundFetchRecords to the
BackgroundFetchRegistration object, and updates it every time match and
matchAll() are called.

The second change introduced here is to not immediately resolve
responseReady() if the fetch is active and a response for the request
isn't yet available. Once the fetch has completed, or there's a response
available for the request, we resolve pending promises. We also make sure to
return the same promise (resolved or unresolved) for a given record,
every time responseReady is called.

For a more detailed discussion, see the following doc:
https://docs.google.com/document/d/1CrbWrnnshhyp_SfiAeuODpnQX36GK3Bsi19rXQGez6Q/edit?usp=sharing

Bug: 875201

Change-Id: I8cb386efd19086c0993ad2be2fb2691ad90597ec
Reviewed-on: https://chromium-review.googlesource.com/c/1336151
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Reviewed-by: Rayan Kanso <rayankans@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610410}

--

wpt-commits: 12720fdc8914deec3e7cc627036a26217cc1e908
wpt-pr: 14060
2018-12-11 15:49:33 +00:00
..
sw-abort.js Bug 1499505 [wpt PR 13549] - [Background Fetch] Throw DOMException for responseReady on abort., a=testonly 2018-11-07 14:40:16 +00:00
sw-helpers.js Bug 1485405 [wpt PR 12622] - [BackgroundFetch] Part 2: Implement BackgroundFetchFailureReason., a=testonly 2018-08-31 10:29:03 +00:00
sw-update-ui.js Bug 1505173 [wpt PR 13955] - [Background Fetch] Reject call to updateUI if event is inactive., a=testonly 2018-11-14 13:38:05 +00:00
sw.js Bug 1507325 [wpt PR 14060] - Add a list of BackgroundFetchRecord objects to BackgroundFetchRegistration., a=testonly 2018-12-11 15:49:33 +00:00