goQuitApplication called before window.close()

RESOLVED WORKSFORME

Status

Testing
Talos
RESOLVED WORKSFORME
7 years ago
3 years ago

People

(Reporter: sdwilsh, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Created attachment 460064 [details]
dirty hack

goQuitApplication is always called before window.close(), which means window.close is never called.  This isn't a problem currently for talos because we only run Firefox in the configuration that it only ever loads the page specified on the command line or the home page.  However, if you want to run Ts and have it load your windows and tabs from last time, you'll end up gaining a tab for each and every cycle, which makes the test useless.

I've sorta fixed this with the attached quit.js which modifies goQuitApplication to dump something into the event loop on the main thread.  It's not pretty, but the hack worked for my testing at least.  (there is also an unrelated change that adds a method to count tabs which is how I was able to log this in the first place)
(Reporter)

Updated

7 years ago
I believe that you could also get the desired result by running the browser for the ts test with -private - so that the ts page itself wouldn't get added to the sessionstore.  I've used that before when playing around with restoring sets of tabs/windows repeatably.

Might be a better option then what you admit is a dirty hack. :)
(Reporter)

Comment 2

7 years ago
Hmm, is that documented somewhere?  Also, it's only a dirty hack because I just threw some code in there to make it work, but the approach is perfectly fine (we do similar things in tests).
You can see -private here https://developer.mozilla.org/en/Command_Line_Options

"
Opens Firefox in private browsing mode, regardless of the current user preference. Firefox 3.6 and later only.
"
I'm not sure that we want private browsing here.. that seems like a rather large hammer to pull out :)
(Reporter)

Comment 5

7 years ago
I'm also not sure that does what I actually wanted, which was to open up the eight tabs I had open.  If we opened it in private browsing, I'm pretty sure that would only open the talos tab.
From my testing it does do you what you want (if you have a session it restores it, but it does not save any new tabs that you add).  But, if using -private is undesirable then that is okay too.

Just sayin' that it works. :)
this doesn't seem to be a problem anymore, if I hear no objections, I will close this.

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.