Closed
Bug 723953
Opened 14 years ago
Closed 13 years ago
Fennec chrome scripts and tests leak global variables
Categories
(Firefox for Android Graveyard :: General, defect)
Firefox for Android Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 14
People
(Reporter: mbrubeck, Assigned: dao)
References
Details
Attachments
(1 file, 1 obsolete file)
|
18.81 KB,
patch
|
mbrubeck
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #720985 +++
XUL-Fennec browser-chrome tests went permaorange when bug 720985 landed because they leak global variables:
https://tbpl.mozilla.org/php/getParsedLog.php?id=9059420&tree=Firefox
These variables have been temporarily added to the whitelist, but we should fix the tests to stop them from leaking.
| Reporter | ||
Comment 1•14 years ago
|
||
I haven't tested this yet. Pushed to Try:
https://tbpl.mozilla.org/?tree=Try&rev=046cb8306f36
| Reporter | ||
Updated•14 years ago
|
Attachment #594244 -
Attachment is patch: true
| Assignee | ||
Comment 2•14 years ago
|
||
Comment on attachment 594244 [details] [diff] [review]
patch
So DownloadUtils and AddonRepository should remain whitelisted? Why?
| Reporter | ||
Comment 3•14 years ago
|
||
(In reply to Dão Gottwald [:dao] from comment #2)
> Comment on attachment 594244 [details] [diff] [review]
> patch
>
> So DownloadUtils and AddonRepository should remain whitelisted? Why?
These are loaded lazily by Fennec chrome after the first content document has loaded. Because of this, they are showing up as "leaked" by whichever test runs first. I'm still thinking about any better way around this. Suggestions?
| Assignee | ||
Comment 4•14 years ago
|
||
How and where are they loaded lazily? An ordinary lazy getter wouldn't have this problem since getters appear in the keys list, right?
| Reporter | ||
Comment 5•14 years ago
|
||
One is imported from downloads.js:
http://mxr.mozilla.org/mozilla-central/source/mobile/xul/chrome/content/downloads.js#38
And the other from a lazy importer in extensions.js:
http://mxr.mozilla.org/mozilla-central/source/mobile/xul/chrome/content/extensions.js#57
The problem is that these files are themselves lazily loaded after startup, here:
https://mxr.mozilla.org/mozilla-central/source/mobile/xul/chrome/content/browser-scripts.js#99
Creating the DownloadUtils and AddonRepository getters directly in browser-scripts.js at startup, instead of within other lazily-loaded files, would probably solve this problem. I'll try that next.
My Try push still had two errors, so it looks like I also failed to fix these tests:
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/mobile/chrome/tests/browser_localerepository.js | leaked window property: LocaleRepository
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/mobile/chrome/tests/browser_vkb.js | leaked window property: VKBstateHasChanged
http://ftp.mozilla.org/pub/mozilla.org/mobile/try-builds/mbrubeck@mozilla.com-046cb8306f36/try-android-xul/try_tegra_android-xul_test-browser-chrome-build506.txt.gz
Status: NEW → ASSIGNED
| Assignee | ||
Comment 6•14 years ago
|
||
(In reply to Matt Brubeck (:mbrubeck) from comment #5)
> One is imported from downloads.js:
> http://mxr.mozilla.org/mozilla-central/source/mobile/xul/chrome/content/
> downloads.js#38
>
> And the other from a lazy importer in extensions.js:
> http://mxr.mozilla.org/mozilla-central/source/mobile/xul/chrome/content/
> extensions.js#57
>
> The problem is that these files are themselves lazily loaded after startup,
> here:
> https://mxr.mozilla.org/mozilla-central/source/mobile/xul/chrome/content/
> browser-scripts.js#99
They are explicitly loaded in a sandbox, though, so the getters leaking outside seems unintentional.
> Creating the DownloadUtils and AddonRepository getters directly in
> browser-scripts.js at startup, instead of within other lazily-loaded files,
> would probably solve this problem. I'll try that next.
Yes, if you actually want these objects there.
| Assignee | ||
Comment 7•14 years ago
|
||
(In reply to Matt Brubeck (:mbrubeck) from comment #5)
> My Try push still had two errors, so it looks like I also failed to fix
> these tests:
> TEST-UNEXPECTED-FAIL |
> chrome://mochitests/content/browser/mobile/chrome/tests/browser_vkb.js |
> leaked window property: VKBstateHasChanged
This is a typo, VKBstateHasChanged vs. VKBStateHasChanged.
| Assignee | ||
Comment 8•13 years ago
|
||
Assignee: mbrubeck → dao
Attachment #612975 -
Flags: review?(mbrubeck)
| Assignee | ||
Updated•13 years ago
|
Attachment #594244 -
Attachment is obsolete: true
| Assignee | ||
Updated•13 years ago
|
Version: Firefox 13 → Trunk
| Reporter | ||
Comment 9•13 years ago
|
||
Comment on attachment 612975 [details] [diff] [review]
patch v2
Thanks for following up on this, Dão!
Attachment #612975 -
Flags: review?(mbrubeck) → review+
| Assignee | ||
Comment 10•13 years ago
|
||
Summary: Fennec tests leak global variables → Fennec chrome scripts and tests leak global variables
Target Milestone: --- → Firefox 14
| Reporter | ||
Comment 11•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•