Last Comment Bug 581711 - goQuitApplication called before window.close()
: goQuitApplication called before window.close()
Product: Testing
Classification: Components
Component: Talos (show other bugs)
: unspecified
: x86 Windows 7
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on:
  Show dependency treegraph
Reported: 2010-07-24 13:59 PDT by Shawn Wilsher :sdwilsh
Modified: 2014-12-15 07:27 PST (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

dirty hack (5.05 KB, text/plain)
2010-07-24 13:59 PDT, Shawn Wilsher :sdwilsh
no flags Details

Description User image Shawn Wilsher :sdwilsh 2010-07-24 13:59:01 PDT
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)
Comment 1 User image alice nodelman [:alice] [:anode] 2010-07-26 13:27:43 PDT
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 User image Shawn Wilsher :sdwilsh 2010-07-26 13:41:51 PDT
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).
Comment 3 User image alice nodelman [:alice] [:anode] 2010-07-26 14:20:16 PDT
You can see -private here

Opens Firefox in private browsing mode, regardless of the current user preference. Firefox 3.6 and later only.
Comment 4 User image Vladimir Vukicevic [:vlad] [:vladv] 2010-07-26 14:23:18 PDT
I'm not sure that we want private browsing here.. that seems like a rather large hammer to pull out :)
Comment 5 User image Shawn Wilsher :sdwilsh 2010-07-26 14:29:03 PDT
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.
Comment 6 User image alice nodelman [:alice] [:anode] 2010-07-26 15:45:20 PDT
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. :)
Comment 7 User image Joel Maher ( :jmaher) 2012-09-26 11:14:48 PDT
this doesn't seem to be a problem anymore, if I hear no objections, I will close this.

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