Skip to content

Commit

Permalink
Bug 1336763 - Wait for the browser to say it can go back before going…
Browse files Browse the repository at this point in the history
… back in browser_grouped_shistory_dead_navigate.js test. r=mystor

This test was accidentally taking advantage of the fact that closing a tab will result
in a nested event loop while waiting for the permitUnload messages to be sent back and
forth from the content process. This meant that the message that tells the parent that
the browser (which is having its history set) can now go back had a chance to be received
by the parent.

With the patches in bug 1336763, we're no longer spinning the event loop if the closing
tab doesn't have a beforeunload event handler in it, so we need to wait for the browser
to report that it can go back before actually sending it back in order to avoid a
test failure.

MozReview-Commit-ID: Lpl55iErrvf

--HG--
extra : rebase_source : 87b2d6a0fb448f729b82860de9d17c0db26097e7
  • Loading branch information
mikeconley committed Apr 27, 2017
1 parent 009b756 commit a6486de
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ add_task(function* () {

// Close tab2 such that the back frameloader is dead
yield BrowserTestUtils.removeTab(tab2);
yield BrowserTestUtils.waitForCondition(() => browser1.canGoBack);
browser1.goBack();
yield BrowserTestUtils.browserLoaded(browser1);
yield ContentTask.spawn(browser1, null, function() {
Expand Down

0 comments on commit a6486de

Please sign in to comment.