goQuitApplication called before window.close()



9 years ago
4 years ago


(Reporter: sdwilsh, Unassigned)


Firefox Tracking Flags

(Not tracked)




(1 attachment)



9 years ago
Posted file 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)
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. :)

Comment 2

9 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 :)

Comment 5

9 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.
Last Resolved: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.