Closed Bug 1127264 Opened 9 years ago Closed 9 years ago

Clean up sessionstore tests

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal
Points:
3

Tracking

()

RESOLVED FIXED
Firefox 38
Iteration:
38.2 - 9 Feb

People

(Reporter: ttaubert, Assigned: ttaubert)

Details

Attachments

(1 file)

I just stumbled upon a test that's still using the about:newtab TestRunner (meh). Getting rid of that isn't hard as the test is already async fortunately. Let's clean up some more old helper functions while we're at it.
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Iteration: --- → 38.2 - 9 Feb
Points: --- → 3
Flags: qe-verify-
Flags: firefox-backlog+
This patch does the following:

1) Removes whenBrowserLoaded() and replaces it with promiseBrowserLoaded(). Remove whenTabRestored() and replace it with promiseTabRestored().

2) Gets rid of the about:newtab TestRunner().

3) Fixes a place that was using promiseBrowserLoaded() where it should have been waiting for promiseBrowserRestored(). Not a big difference in that specific test but certainly more correct.

4) Combines setTabState() & promiseTabRestored() calls into promiseTabState().

5) Refactores browser_819510_perwindowpb.js which invented its own TestRunner.

6) Adds forgetClosedWindows() to head.js as a helper function to forget all closed windows.

7) Removes some unused helper functions: whenBrowserUnloaded(), promiseBrowserUnloaded(), and loadPage().


I know this won't be super fun to review (sorry!) but I thought it was important to at least do a little cleanup after our tests can be so much nicer with add_task() and Promises now.
Attachment #8556408 - Flags: review?(smacleod)
Comment on attachment 8556408 [details] [diff] [review]
0001-Bug-1127264-Clean-up-sessionstore-tests.patch

Review of attachment 8556408 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/sessionstore/test/browser_586068-browser_state_interrupted.js
@@ +85,3 @@
>  
> +      // Remove the progress listener from this window, it will be removed from
> +      // theWin when that window is closed (in setBrowserState).

If we're touching this anyways might as well fix up the typo.

::: browser/components/sessionstore/test/browser_819510_perwindowpb.js
@@ +116,1 @@
>  }

This test is much nicer now :)
Attachment #8556408 - Flags: review?(smacleod) → review+
https://hg.mozilla.org/mozilla-central/rev/4f22f76a622d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: