gecko-dev/testing/web-platform/tests/web-locks/resources/service-worker.js
Joshua Bell 3cb7b1360c Bug 1472022 [wpt PR 11713] - Web Locks API: Upstream tests to web-platform-tests (as .tentative), a=testonly
Automatic update from web-platform-testsWeb Locks API: Upstream tests to web-platform-tests (as .tentative)

* Move tests from http/tests/locks to external/wpt/web-locks
* Name with '.tentative' infix since this is still just a proposal
* Name most tests with '.https' infix since feature is [SecureContext]
   (and remove redirect-to-secure-host logic in tests)
* Consolidate window/worker interfaces test with '.any.js' variant
* Update paths to service worker helpers

Bug: 857265
Change-Id: Iaf254c5d53ff5b6bb65de4516df85307ad3a6519
Reviewed-on: https://chromium-review.googlesource.com/1118764
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573991}

--

wpt-commits: 89ccb892ad85159b093dab6956ca9caea7bb4edc
wpt-pr: 11713
2018-07-24 21:46:13 +00:00

7 lines
244 B
JavaScript

// Responds to '/clientId' with the request's clientId.
self.addEventListener('fetch', e => {
if (new URL(e.request.url).pathname === '/clientId') {
e.respondWith(new Response(JSON.stringify({clientId: e.clientId})));
return;
}
});