Useless counter value in dom/workers/test/serviceworkers/importscript.sjs

RESOLVED FIXED in Firefox 40

Status

()

Core
DOM
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Ehsan, Assigned: baku)

Tracking

unspecified
mozilla40
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

3 years ago
The counter variable there is only ever read from...  Is that test really doing what we want?
Flags: needinfo?(amarchesini)
(Assignee)

Comment 1

3 years ago
Created attachment 8590127 [details] [diff] [review]
counter.patch
Flags: needinfo?(amarchesini)
Attachment #8590127 - Flags: review?(ehsan)
(Reporter)

Comment 2

3 years ago
Comment on attachment 8590127 [details] [diff] [review]
counter.patch

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

::: dom/workers/test/serviceworkers/importscript.sjs
@@ +2,5 @@
>  function handleRequest(request, response) {
>    if (!counter) {
>      response.setHeader("Content-Type", "application/javascript", false);
>      response.write("callByScript();");
> +    counter++;

I'm not sure if this does the right thing.  Have you tested this?

As far as I know, global variables are not preserved across sjs runs.  You probably need to use the getState/setState APIs: <https://dxr.mozilla.org/mozilla-central/source/netwerk/test/httpserver/nsIHttpServer.idl#184>
Attachment #8590127 - Flags: review?(ehsan) → review-
(Assignee)

Comment 3

3 years ago
Created attachment 8590433 [details] [diff] [review]
counter.patch
Attachment #8590127 - Attachment is obsolete: true
Attachment #8590433 - Flags: review?(ehsan)
(Reporter)

Updated

3 years ago
Attachment #8590433 - Flags: review?(ehsan) → review+
(Assignee)

Updated

3 years ago
Assignee: nobody → amarchesini
OS: Mac OS X → All
Hardware: x86 → All
https://hg.mozilla.org/mozilla-central/rev/89f9815da675
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox40: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.