summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sessions
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-24 09:34:14 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-24 09:34:14 +0000
commit4cc8eb5b72b445d6ec8ad965588f2014012947a2 (patch)
tree6dba80504dacb24991ba037397f2563aa9cf9a26 /chrome/browser/sessions
parent309d7a28aa6c938f60ac7a543ab4a73827d29562 (diff)
downloadchromium_src-4cc8eb5b72b445d6ec8ad965588f2014012947a2.zip
chromium_src-4cc8eb5b72b445d6ec8ad965588f2014012947a2.tar.gz
chromium_src-4cc8eb5b72b445d6ec8ad965588f2014012947a2.tar.bz2
Get rid of WaitForWindowCountToChange.
The function had confusing semantics, was marked to be removed, and could induce flakiness in tests which used it. WaitForWindowCountToBecome is much better replacement for it. Review URL: http://codereview.chromium.org/49007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r--chrome/browser/sessions/session_restore_uitest.cc28
1 files changed, 6 insertions, 22 deletions
diff --git a/chrome/browser/sessions/session_restore_uitest.cc b/chrome/browser/sessions/session_restore_uitest.cc
index cd00a93..431b66e 100644
--- a/chrome/browser/sessions/session_restore_uitest.cc
+++ b/chrome/browser/sessions/session_restore_uitest.cc
@@ -50,11 +50,8 @@ class SessionRestoreUITest : public UITest {
ASSERT_TRUE(browser_proxy.get());
ASSERT_TRUE(browser_proxy->ApplyAccelerator(IDC_CLOSE_WINDOW));
browser_proxy.reset();
- int window_count;
- ASSERT_TRUE(automation()->WaitForWindowCountToChange(initial_count,
- &window_count,
+ ASSERT_TRUE(automation()->WaitForWindowCountToBecome(initial_count - 1,
action_timeout_ms()));
- ASSERT_EQ(initial_count - 1, window_count);
}
void AssertOneWindowWithOneTab() {
@@ -273,10 +270,7 @@ TEST_F(SessionRestoreUITest, DISABLED_DontRestoreWhileIncognito) {
// Create an off the record window and wait for it to appear.
ASSERT_TRUE(browser_proxy->ApplyAccelerator(IDC_NEW_INCOGNITO_WINDOW));
- int window_count;
- ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count,
- action_timeout_ms()) &&
- window_count == 2);
+ ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, action_timeout_ms()));
// Close the first window.
CloseWindow(0, 2);
@@ -291,9 +285,7 @@ TEST_F(SessionRestoreUITest, DISABLED_DontRestoreWhileIncognito) {
LaunchBrowser(launch_arguments_, false);
// A new window should appear;
- ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count,
- action_timeout_ms()) &&
- window_count == 2);
+ ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, action_timeout_ms()));
// And it shouldn't have url1 in it.
browser_proxy.reset(automation()->GetBrowserWindow(1));
@@ -320,10 +312,7 @@ TEST_F(SessionRestoreUITest, DISABLED_TwoWindowsCloseOneRestoreOnlyOne) {
// Open a second window.
ASSERT_TRUE(automation()->OpenNewBrowserWindow(SW_SHOWNORMAL));
- int window_count;
- ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count,
- action_timeout_ms()) &&
- window_count == 2);
+ ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, action_timeout_ms()));
// Close it.
CloseWindow(1, 2);
@@ -353,10 +342,7 @@ TEST_F(SessionRestoreUITest,
app_launch_arguments.AppendSwitchWithValue(switches::kApp,
UTF8ToWide(url2.spec()));
LaunchBrowser(app_launch_arguments, false);
- int window_count;
- ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count,
- action_timeout_ms()));
- ASSERT_EQ(2, window_count);
+ ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, action_timeout_ms()));
// Close the first window.
CloseWindow(0, 2);
@@ -365,9 +351,7 @@ TEST_F(SessionRestoreUITest,
CommandLine restore_launch_arguments = launch_arguments_;
restore_launch_arguments.AppendSwitch(switches::kRestoreLastSession);
LaunchBrowser(restore_launch_arguments, false);
- ASSERT_TRUE(automation()->WaitForWindowCountToChange(1, &window_count,
- action_timeout_ms()));
- ASSERT_EQ(2, window_count);
+ ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, action_timeout_ms()));
GURL url;
AssertWindowHasOneTab(1, &url);
ASSERT_EQ(url1, url);