Last Comment Bug 719849 - global variables pollute the browser window during devtools tests
: global variables pollute the browser window during devtools tests
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Developer Tools (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 12
Assigned To: Dão Gottwald [:dao]
:
Mentors:
: 677996 (view as bug list)
Depends on:
Blocks: bc-leaks 720985
  Show dependency treegraph
 
Reported: 2012-01-20 08:40 PST by Dão Gottwald [:dao]
Modified: 2012-01-25 04:38 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (44.08 KB, patch)
2012-01-20 08:40 PST, Dão Gottwald [:dao]
rcampbell: review+
Details | Diff | Splinter Review

Description Dão Gottwald [:dao] 2012-01-20 08:40:08 PST
Created attachment 590212 [details] [diff] [review]
patch
Comment 1 Dão Gottwald [:dao] 2012-01-20 11:22:06 PST
*** Bug 677996 has been marked as a duplicate of this bug. ***
Comment 2 Rob Campbell [:rc] (:robcee) 2012-01-23 07:44:14 PST
Comment on attachment 590212 [details] [diff] [review]
patch

-Cu.import("resource:///modules/source-editor.jsm");
+let tempScope = {};
+Cu.import("resource:///modules/source-editor.jsm", tempScope);
+let SourceEditor = tempScope.SourceEditor;

this is a good pattern, but I wish it weren't necessary every time.

Does SimpleTest really not tear-down its environment after each test instance? Seems like we could do something there.

in any case, this looks solid. Should land ASAP.
Comment 3 Rob Campbell [:rc] (:robcee) 2012-01-23 08:00:09 PST
https://hg.mozilla.org/integration/fx-team/rev/fd894e4a7569
Comment 4 Dão Gottwald [:dao] 2012-01-23 08:09:42 PST
> Does SimpleTest really not tear-down its environment after each test
> instance? Seems like we could do something there.

All browser chrome tests run in the same browser window, so if you add something to the window object, it's going to stick around. SimpleTest can't clean this up. The browser chrome test suite could open a new window for each test...

> https://hg.mozilla.org/integration/fx-team/rev/fd894e4a7569

Thanks, but it's "Dão" with a tilde. (One reason why I usually push my stuff myself.)
Comment 5 Rob Campbell [:rc] (:robcee) 2012-01-23 12:40:22 PST
(In reply to Dão Gottwald [:dao] from comment #4)
> > https://hg.mozilla.org/integration/fx-team/rev/fd894e4a7569
> 
> Thanks, but it's "Dão" with a tilde. (One reason why I usually push my stuff
> myself.)

Sorry Dão (proving that I *can* type the tilde). I've had bad luck with UTF characters in push comments before so I left it out. If the spelling's really annoying, feel free to backout and repush.

I wanted to land this on fx-team to let people who have in-progress patches that they might have to rebase some test code rather than get bit by a merge from inbound.
Comment 6 Tim Taubert [:ttaubert] 2012-01-24 06:09:47 PST
https://hg.mozilla.org/mozilla-central/rev/fd894e4a7569
Comment 7 Marco Bonardo [::mak] (Away 6-20 Aug) 2012-01-24 06:18:06 PST
(In reply to Rob Campbell [:rc] (robcee) from comment #5)
> I've had bad luck with UTF
> characters in push comments before so I left it out.

if you're on Win you may try with "hgencoding=utf-8 hg command", it worked for me in the past

Note You need to log in before you can comment on or make changes to this bug.