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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_path.h" 5 #include "base/file_path.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "base/test/test_file_util.h" 9 #include "base/test/test_file_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // Verify that the window is present. 322 // Verify that the window is present.
323 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 323 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
324 ASSERT_TRUE(browser.get()); 324 ASSERT_TRUE(browser.get());
325 325
326 // Verify the browser is an application. 326 // Verify the browser is an application.
327 Browser::Type type; 327 Browser::Type type;
328 ASSERT_TRUE(browser->GetType(&type)); 328 ASSERT_TRUE(browser->GetType(&type));
329 EXPECT_EQ(Browser::TYPE_APP, type); 329 EXPECT_EQ(Browser::TYPE_APP, type);
330 } 330 }
331 331
332 // Tests to ensure that the browser continues running in the background after
333 // the last window closes.
334 class RunInBackgroundTest : public UITest {
335 public:
336 RunInBackgroundTest() {
337 launch_arguments_.AppendSwitch(switches::kKeepAliveForTest);
338 }
339 };
340
341 TEST_F(RunInBackgroundTest, RunInBackgroundBasicTest) {
342 // Close the browser window, then open a new one - the browser should keep
343 // running.
344 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
345 ASSERT_TRUE(browser.get());
346 int window_count;
347 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
348 EXPECT_EQ(1, window_count);
349 ASSERT_TRUE(browser->RunCommand(IDC_CLOSE_WINDOW));
350 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
351 EXPECT_EQ(0, window_count);
352 ASSERT_TRUE(IsBrowserRunning());
353 ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, true));
354 ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
355 EXPECT_EQ(1, window_count);
356 }
357
332 } // namespace 358 } // namespace
OLDNEW
« 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