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

Unified Diff: chrome/browser/browser_uitest.cc

Issue 2866034: Refactor shutdown code to allow win/linux to run after last browser closes. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Uploaded patch that resolves merge issue Created 10 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
« no previous file with comments | « chrome/browser/browser_shutdown.cc ('k') | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_uitest.cc
diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc
index eb66e13f6633d4c826c420b99ba76ed00d0ce5d1..2058b189631b62d672248b1091b96e93ab5e3a48 100644
--- a/chrome/browser/browser_uitest.cc
+++ b/chrome/browser/browser_uitest.cc
@@ -329,4 +329,30 @@ TEST_F(AppModeTest, EnableAppModeTest) {
EXPECT_EQ(Browser::TYPE_APP, type);
}
+// Tests to ensure that the browser continues running in the background after
+// the last window closes.
+class RunInBackgroundTest : public UITest {
+ public:
+ RunInBackgroundTest() {
+ launch_arguments_.AppendSwitch(switches::kKeepAliveForTest);
+ }
+};
+
+TEST_F(RunInBackgroundTest, RunInBackgroundBasicTest) {
+ // Close the browser window, then open a new one - the browser should keep
+ // running.
+ scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(browser.get());
+ int window_count;
+ ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
+ EXPECT_EQ(1, window_count);
+ ASSERT_TRUE(browser->RunCommand(IDC_CLOSE_WINDOW));
+ ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
+ EXPECT_EQ(0, window_count);
+ ASSERT_TRUE(IsBrowserRunning());
+ ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, true));
+ ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
+ EXPECT_EQ(1, window_count);
+}
+
} // namespace
« no previous file with comments | « chrome/browser/browser_shutdown.cc ('k') | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698