Closed Bug 1142333 Opened 10 years ago Closed 10 years ago

Add a test for passing Request objects to DOM cache match methods

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file)

No description provided.
Assignee: nobody → ehsan
Blocks: cachetests
Comment on attachment 8576327 [details] [diff] [review] Add a test for passing Request objects to DOM cache match methods Review of attachment 8576327 [details] [diff] [review]: ----------------------------------------------------------------- I'm not sure how you are planning to split things up, but we also need to test match with: 1) vary headers 2) ignoreSearch=true 3) ignoreVary=true 4) ignoreMethod=true Are these in this bug or a later bug? Either way is fine. Dropping review for now till thats clarified. ::: dom/cache/test/mochitest/test_cache_match_request.js @@ +5,5 @@ > + > +function checkResponse(r) { > + ok(r !== response, "The objects should not be the same"); > + is(r.url, response.url, "The URLs should be the same"); > + is(r.status, response.status, "The status codes should be the same"); Also compare .type, .ok, and .statusText for completeness, please. @@ +39,5 @@ > + is(err.name, "NotFoundError", "Searching in the wrong cache should not succeed"); > +}).then(function() { > + return caches.delete("match-request"); > +}).then(function(success) { > + ok(success, "We should be able to delete the cache successfully"); You are still holding the Cache alive through |c| here. Maybe do another c.match to prove that the Cache is still usable even after a delete? Then you could drop |c| and do |caches.open("match-request")| again and show that the match fails on the newly returned Cache.
Attachment #8576327 - Flags: review?(bkelly)
Also we should test: 1) match(unknownRequest) and verify it resolves undefined 2) match with a url string instead of a request object 3) match with different request methods and verify GET/HEAD succeed, but other methods fail appropriately 4) verify a body cannot be passed with the request because its not allowed on GET/HEAD (although this is really a fetch requirement at this point) All of these effectively apply to bug 1142790 as well.
Comment on attachment 8576327 [details] [diff] [review] Add a test for passing Request objects to DOM cache match methods Review of attachment 8576327 [details] [diff] [review]: ----------------------------------------------------------------- Ehsan clarified on IRC he wants to do this stuff in follow-ups. LGTM.
Attachment #8576327 - Flags: review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: