OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/test/ui/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 11 #include "base/test/test_suite.h" |
11 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_list.h" | 13 #include "chrome/browser/ui/browser_list.h" |
13 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
14 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
18 #include "content/public/browser/navigation_controller.h" | 19 #include "content/public/browser/navigation_controller.h" |
19 #include "content/public/browser/navigation_entry.h" | 20 #include "content/public/browser/navigation_entry.h" |
20 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
(...skipping 22 matching lines...) Expand all Loading... |
43 iter != switches.end(); ++iter) { | 44 iter != switches.end(); ++iter) { |
44 new_command_line_.AppendSwitchNative((*iter).first, (*iter).second); | 45 new_command_line_.AppendSwitchNative((*iter).first, (*iter).second); |
45 } | 46 } |
46 | 47 |
47 FilePath user_data_dir; | 48 FilePath user_data_dir; |
48 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 49 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
49 new_command_line_.AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 50 new_command_line_.AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
50 | 51 |
51 new_command_line_.AppendSwitchASCII( | 52 new_command_line_.AppendSwitchASCII( |
52 test_launcher::kGTestFilterFlag, test_launcher::kEmptyTestName); | 53 test_launcher::kGTestFilterFlag, test_launcher::kEmptyTestName); |
| 54 new_command_line_.AppendSwitch(TestSuite::kSilent); |
53 } | 55 } |
54 | 56 |
55 void Relaunch() { | 57 void Relaunch() { |
56 base::LaunchProcess(new_command_line_, base::LaunchOptions(), NULL); | 58 base::LaunchProcess(new_command_line_, base::LaunchOptions(), NULL); |
57 } | 59 } |
58 | 60 |
59 protected: | 61 protected: |
60 CommandLine new_command_line_; | 62 CommandLine new_command_line_; |
61 }; | 63 }; |
62 | 64 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 content::NotificationService::AllSources()); | 142 content::NotificationService::AllSources()); |
141 Relaunch(); | 143 Relaunch(); |
142 tab_observer.Wait(); | 144 tab_observer.Wait(); |
143 | 145 |
144 // There should be one normal and one incognito window now. | 146 // There should be one normal and one incognito window now. |
145 ASSERT_EQ(2u, BrowserList::size()); | 147 ASSERT_EQ(2u, BrowserList::size()); |
146 ASSERT_EQ(1u, BrowserList::GetBrowserCountForType(profile, true)); | 148 ASSERT_EQ(1u, BrowserList::GetBrowserCountForType(profile, true)); |
147 } | 149 } |
148 | 150 |
149 #endif // !OS_MACOSX | 151 #endif // !OS_MACOSX |
OLD | NEW |