From ed2fa729af0311cc4d5f30be5f0368fad248d64a Mon Sep 17 00:00:00 2001 From: "gab@chromium.org" Date: Tue, 25 Jun 2013 20:37:34 +0000 Subject: Make all tests use GetActiveDesktop() instead of hardcoding HOST_DESKTOP_TYPE_NATIVE. Core components (in chrome/test/base/in_process_browser_test.cc): 1) Adds a check to ensure that browsers are only created on the tested desktop -- **postponed to a follow-up CL**. 2) Adds the --silent-launch flag to Ash browser_tests to prevent Ash browser_tests from using the regular startup path which is hardcoded to open a browser on the native desktop (--silent-launch is also used by the real Chrome viewer when it launches in Ash). Also clarified comments in chrome/browser/ui/host_desktop.h to highlight the fact that hardcoded enums and GetActiveDesktop() are not usually what you should use (especially since GetActiveDesktop() is used more often in tests now, I don't want people to believe it's the right way to get the current desktop in non-test code). BUG=179830 TEST="browser_tests --ash-browsertests" mostly works (i.e. tested manually and test passes with no window ever popping on the native desktop)! Review URL: https://chromiumcodereview.appspot.com/17379022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208541 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/browser_command_controller_unittest.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'chrome/browser/ui/browser_command_controller_unittest.cc') diff --git a/chrome/browser/ui/browser_command_controller_unittest.cc b/chrome/browser/ui/browser_command_controller_unittest.cc index 87e9be5..6d50522 100644 --- a/chrome/browser/ui/browser_command_controller_unittest.cc +++ b/chrome/browser/ui/browser_command_controller_unittest.cc @@ -301,8 +301,7 @@ TEST_F(BrowserCommandControllerTest, profile1->SetOffTheRecordProfile(profile2); // Create a new browser based on the off the record profile. - Browser::CreateParams profile_params(profile2, - chrome::HOST_DESKTOP_TYPE_NATIVE); + Browser::CreateParams profile_params(profile2, chrome::GetActiveDesktop()); scoped_ptr browser2( chrome::CreateBrowserWithTestWindowForParams(&profile_params)); -- cgit v1.1