Add a test for checking the Request.context attribute for FetchEvents generated for fetch()

RESOLVED FIXED in Firefox 39

Status

()

Core
DOM
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

unspecified
mozilla39
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox39 fixed)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

3 years ago
Created attachment 8583054 [details] [diff] [review]
Add a test for checking the Request.context attribute for FetchEvents generated for fetch()
Attachment #8583054 - Flags: review?(nsm.nikhil)
(Assignee)

Updated

3 years ago
Assignee: nobody → ehsan
Blocks: 1121157
Comment on attachment 8583054 [details] [diff] [review]
Add a test for checking the Request.context attribute for FetchEvents generated for fetch()

Review of attachment 8583054 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/workers/test/serviceworkers/fetch/context/context_test.js
@@ +2,5 @@
> +  if (event.request.url.indexOf("fetch.txt") >= 0) {
> +    var body = event.request.context == "fetch" ?
> +               "so fetch" : "so unfetch";
> +    event.respondWith(new Response(body));
> +  }

Could you add a event.respondWith(Promise.reject()); after the if block so that we never make this sw handle other fetches without finding out about it.
Attachment #8583054 - Flags: review?(nsm.nikhil) → review+
https://hg.mozilla.org/mozilla-central/rev/568da0ccb3ad
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox39: --- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.