Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Unified Diff: chrome/browser/sessions/session_restore_uitest.cc

Issue 28051: Attempt at fixing flakeyness when running session restore ui tests in... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_init.cc ('k') | chrome/common/chrome_switches.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore_uitest.cc
===================================================================
--- chrome/browser/sessions/session_restore_uitest.cc (revision 10207)
+++ chrome/browser/sessions/session_restore_uitest.cc (working copy)
@@ -5,6 +5,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/scoped_ptr.h"
+#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -33,12 +34,13 @@
path_prefix.AppendASCII("bot3.html"));
}
- virtual void QuitBrowserAndRestore() {
+ virtual void QuitBrowserAndRestore(int expected_tab_count) {
UITest::TearDown();
clear_profile_ = false;
- launch_arguments_.AppendSwitch(switches::kRestoreLastSession);
+ launch_arguments_.AppendSwitchWithValue(switches::kRestoreLastSession,
+ IntToWString(expected_tab_count));
UITest::SetUp();
}
@@ -96,7 +98,7 @@
NavigateToURL(url1);
NavigateToURL(url2);
- QuitBrowserAndRestore();
+ QuitBrowserAndRestore(1);
// NOTE: Don't use GetActiveWindow here, when run with the screen locked
// active windows returns NULL.
@@ -120,7 +122,7 @@
scoped_ptr<TabProxy> active_tab(GetActiveTab());
ASSERT_TRUE(active_tab->GoBack());
- QuitBrowserAndRestore();
+ QuitBrowserAndRestore(1);
// NOTE: Don't use GetActiveWindow here, when run with the screen locked
// active windows returns NULL.
@@ -158,7 +160,7 @@
scoped_ptr<TabProxy> active_tab(GetActiveTab());
ASSERT_TRUE(active_tab->GoBack());
- QuitBrowserAndRestore();
+ QuitBrowserAndRestore(1);
// NOTE: Don't use GetActiveWindow here, when run with the screen locked
// active windows returns NULL.
@@ -201,7 +203,7 @@
ASSERT_TRUE(browser_proxy->AppendTab(url2));
- QuitBrowserAndRestore();
+ QuitBrowserAndRestore(2);
browser_proxy.reset();
ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count) &&
@@ -246,7 +248,7 @@
scoped_ptr<TabProxy> active_tab(browser_proxy->GetActiveTab());
active_tab->Close(true);
- QuitBrowserAndRestore();
+ QuitBrowserAndRestore(1);
browser_proxy.reset();
tab_proxy.reset();
@@ -328,7 +330,7 @@
// Restart and make sure we have only one window with one tab and the url
// is url1.
- QuitBrowserAndRestore();
+ QuitBrowserAndRestore(1);
AssertOneWindowWithOneTab();
@@ -412,7 +414,7 @@
// Restart.
browser_proxy.reset();
last_tab.reset();
- QuitBrowserAndRestore();
+ QuitBrowserAndRestore(3);
// Wait for each tab to finish being restored, then make sure the process
// count matches.
« no previous file with comments | « chrome/browser/browser_init.cc ('k') | chrome/common/chrome_switches.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698