Last Comment Bug 659591 - Fire SSWindowClosing when session store handles a closing window (on domwindowclosed)
: Fire SSWindowClosing when session store handles a closing window (on domwindo...
Product: Firefox
Classification: Client Software
Component: Session Restore (show other bugs)
: Trunk
: All All
-- normal (vote)
: Firefox 7
Assigned To: Tim Taubert [:ttaubert]
: Mike de Boer [:mikedeboer]
Depends on:
Blocks: 655269
  Show dependency treegraph
Reported: 2011-05-25 02:57 PDT by Tim Taubert [:ttaubert]
Modified: 2011-06-10 13:10 PDT (History)
1 user (show)
ehsan: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch v1 (2.73 KB, patch)
2011-05-25 05:27 PDT, Tim Taubert [:ttaubert]
no flags Details | Diff | Splinter Review
patch v2 (2.73 KB, patch)
2011-06-03 09:07 PDT, Tim Taubert [:ttaubert]
paul: review+
Details | Diff | Splinter Review

Description User image Tim Taubert [:ttaubert] 2011-05-25 02:57:47 PDT
From bug 655269 comment #7:

So we should probably do like what we do for tabs (SSTabClosing), which is fired at the beginning of sessionstore processing the TabClose event. We can add SSWindowClosing.
Comment 1 User image Tim Taubert [:ttaubert] 2011-05-25 05:27:22 PDT
Created attachment 535038 [details] [diff] [review]
patch v1
Comment 2 User image Tim Taubert [:ttaubert] 2011-05-25 09:15:25 PDT
Comment on attachment 535038 [details] [diff] [review]
patch v1

Passed try:
Comment 3 User image Tim Taubert [:ttaubert] 2011-06-03 09:07:40 PDT
Created attachment 537155 [details] [diff] [review]
patch v2
Comment 4 User image Paul O'Shannessy [:zpao] (not reading much bugmail, email directly) 2011-06-07 12:29:18 PDT
Comment on attachment 537155 [details] [diff] [review]
patch v2

Review of attachment 537155 [details] [diff] [review]:

::: browser/components/sessionstore/test/browser/browser_659591.js
@@ +6,5 @@
> +
> +  newWindow(function (win) {
> +    win.addEventListener("SSWindowClosing", function onWindowClosing() {
> +      win.removeEventListener("SSWindowClosing", onWindowClosing, false);
> +      waitForFocus(finish);

Let's make is so there's actually a test that passes. Have a variable (gotEvent or something) defaulted to false. Set to true in the SSWindowClosing handler, then register a cleanup function that checks ok(gotEvent).

That way we'll at least have a passing test and if it fails, it won't just be a timeout, we'll actually see a failed test.
Comment 6 User image Boris Zbarsky [:bz] (still a bit busy) 2011-06-09 11:57:38 PDT
Backed out due to mochitest-other orange.

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