| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This test validates that the ProcessSingleton class properly makes sure | 5 // This test validates that the ProcessSingleton class properly makes sure |
| 6 // that there is only one main browser process. | 6 // that there is only one main browser process. |
| 7 // | 7 // |
| 8 // It is currently compiled and run on Windows and Posix(non-Mac) platforms. | 8 // It is currently compiled and run on Windows and Posix(non-Mac) platforms. |
| 9 // Mac uses system services and ProcessSingletonMac is a noop. (Maybe it still | 9 // Mac uses system services and ProcessSingletonMac is a noop. (Maybe it still |
| 10 // makes sense to test that the system services are giving the behavior we | 10 // makes sense to test that the system services are giving the behavior we |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 void StartChrome(base::WaitableEvent* start_event, bool first_run) { | 55 void StartChrome(base::WaitableEvent* start_event, bool first_run) { |
| 56 // TODO(mattm): maybe stuff should be refactored to use | 56 // TODO(mattm): maybe stuff should be refactored to use |
| 57 // UITest::LaunchBrowserHelper somehow? | 57 // UITest::LaunchBrowserHelper somehow? |
| 58 FilePath browser_directory; | 58 FilePath browser_directory; |
| 59 PathService::Get(chrome::DIR_APP, &browser_directory); | 59 PathService::Get(chrome::DIR_APP, &browser_directory); |
| 60 CommandLine command_line(browser_directory.Append( | 60 CommandLine command_line(browser_directory.Append( |
| 61 FilePath::FromWStringHack(chrome::kBrowserProcessExecutablePath))); | 61 FilePath::FromWStringHack(chrome::kBrowserProcessExecutablePath))); |
| 62 | 62 |
| 63 FilePath user_data_directory; | 63 FilePath user_data_directory; |
| 64 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); | 64 PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); |
| 65 command_line.AppendSwitchWithValue(switches::kUserDataDir, | 65 command_line.AppendSwitchPath(switches::kUserDataDir, user_data_directory); |
| 66 user_data_directory.ToWStringHack()); | |
| 67 | 66 |
| 68 if (first_run) | 67 if (first_run) |
| 69 command_line.AppendSwitch(switches::kFirstRun); | 68 command_line.AppendSwitch(switches::kFirstRun); |
| 70 else | 69 else |
| 71 command_line.AppendSwitch(switches::kNoFirstRun); | 70 command_line.AppendSwitch(switches::kNoFirstRun); |
| 72 | 71 |
| 73 // Try to get all threads to launch the app at the same time. | 72 // Try to get all threads to launch the app at the same time. |
| 74 // So let the test know we are ready. | 73 // So let the test know we are ready. |
| 75 ready_event_.Signal(); | 74 ready_event_.Signal(); |
| 76 // And then wait for the test to tell us to GO! | 75 // And then wait for the test to tell us to GO! |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 pending_starters.empty(); | 293 pending_starters.empty(); |
| 295 if (chrome_starters_[last_index]->process_handle_ != | 294 if (chrome_starters_[last_index]->process_handle_ != |
| 296 base::kNullProcessHandle) { | 295 base::kNullProcessHandle) { |
| 297 KillProcessTree(chrome_starters_[last_index]->process_handle_); | 296 KillProcessTree(chrome_starters_[last_index]->process_handle_); |
| 298 chrome_starters_[last_index]->done_event_.Wait(); | 297 chrome_starters_[last_index]->done_event_.Wait(); |
| 299 } | 298 } |
| 300 } | 299 } |
| 301 } | 300 } |
| 302 | 301 |
| 303 } // namespace | 302 } // namespace |
| OLD | NEW |