Closed Bug 1151740 Opened 9 years ago Closed 9 years ago

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

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

Details

Attachments

(1 file)

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: nobody → jwwang
Status: NEW → ASSIGNED
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)
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
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: