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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc

Issue 1228723002: Extract duplicated code in browser_tests for closing a browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/WithoutWaiting/Asynchronously Created 5 years, 5 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
Index: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
index 1e1a055a550f0f221d0f53349bfb6dc77de50fcb..e4af5df13a24b9026dfb5c3a43b3fbcaec3f102b 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
@@ -217,7 +217,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest,
SessionStartupPref::SetStartupPref(browser()->profile(), pref);
// Close the browser.
- browser()->window()->Close();
+ CloseBrowserAsynchronously(browser());
// Do a simple non-process-startup browser launch.
base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
@@ -632,7 +632,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, StartupURLsForTwoProfiles) {
SessionStartupPref::SetStartupPref(other_profile, pref2);
// Close the browser.
- browser()->window()->Close();
+ CloseBrowserAsynchronously(browser());
// Do a simple non-process-startup browser launch.
base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
@@ -690,7 +690,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, PRE_UpdateWithTwoProfiles) {
chrome::NewTab(browser1);
ui_test_utils::NavigateToURL(browser1,
test_server()->GetURL("files/empty.html"));
- browser1->window()->Close();
+ CloseBrowserSynchronously(browser1);
Browser* browser2 = new Browser(
Browser::CreateParams(Browser::TYPE_TABBED, profile2,
@@ -698,7 +698,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, PRE_UpdateWithTwoProfiles) {
chrome::NewTab(browser2);
ui_test_utils::NavigateToURL(browser2,
test_server()->GetURL("files/form.html"));
- browser2->window()->Close();
+ CloseBrowserSynchronously(browser2);
// Set different startup preferences for the 2 profiles.
std::vector<GURL> urls1;
@@ -846,12 +846,12 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest,
chrome::NewTab(browser_last);
ui_test_utils::NavigateToURL(browser_last,
test_server()->GetURL("files/empty.html"));
- browser_last->window()->Close();
+ CloseBrowserAsynchronously(browser_last);
// Close the main browser.
chrome::HostDesktopType original_desktop_type =
browser()->host_desktop_type();
- browser()->window()->Close();
+ CloseBrowserAsynchronously(browser());
// Do a simple non-process-startup browser launch.
base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
@@ -949,7 +949,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) {
SessionStartupPref::SetStartupPref(profile_urls, pref_urls);
// Simulate a launch after an unclear exit.
- browser()->window()->Close();
+ CloseBrowserAsynchronously(browser());
static_cast<ProfileImpl*>(profile_home)->last_session_exit_type_ =
Profile::EXIT_CRASHED;
static_cast<ProfileImpl*>(profile_last)->last_session_exit_type_ =
« no previous file with comments | « chrome/browser/ui/settings_window_manager_browsertest.cc ('k') | chrome/test/base/in_process_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698