JavaScript error: chrome://specialpowers/content/specialpowersAPI.js, line 1437: TypeError: cb is not a function

RESOLVED FIXED in Firefox 40

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jwwang, Assigned: jwwang)

Tracking

unspecified
mozilla40
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
https://hg.mozilla.org/mozilla-central/file/a530b5c3b713/testing/specialpowers/content/specialpowersAPI.js#l1437

repro steps: run mochitests with the following command
|./mach mochitest-plain dom/media/test/ --start-at test_contentDuration1.html --end-at test_contentDuration2.html|

root cause:
test_contentDuration1.html calls mediaTestCleanup() in body unload function. However, after GC, all objects associated with the page are cleaned including the callback object allocated at [1].

[1] https://hg.mozilla.org/mozilla-central/file/a530b5c3b713/dom/media/test/manifest.js#l987
(Assignee)

Comment 1

4 years ago
Created attachment 8589425 [details] [diff] [review]
1151740_fix_GC_callback-v1.patch
Assignee: nobody → jwwang
Status: NEW → ASSIGNED
(Assignee)

Comment 2

4 years ago
Comment on attachment 8589425 [details] [diff] [review]
1151740_fix_GC_callback-v1.patch

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

Try is green: https://treeherder.mozilla.org/#/jobs?repo=try&revision=721cfa3c627e

::: dom/media/test/manifest.js
@@ +985,5 @@
>      for (i=0; i<A.length; i++) {
>        removeNodeAndSource(A[i]);
>        A[i] = null;
>      }
> +    SpecialPowers.exactGC(window, callback);

If |callback| is null, SpecialPowers.exactGC will not invoke the callback object after GC. So we can avoid the problem stated in comment 0.
Attachment #8589425 - Flags: review?(edwin)
(Assignee)

Comment 3

4 years ago
Thanks for the super fast review!!

Try is green: https://treeherder.mozilla.org/#/jobs?repo=try&revision=721cfa3c627e

Please check in this bug after bug 902686 which also modifies manifest.js. Thanks.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/778141c3e5fc
Status: ASSIGNED → RESOLVED
Last Resolved: 4 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.