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 // 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // to start a chrome process at the same time. | 212 // to start a chrome process at the same time. |
213 base::WaitableEvent threads_waker_; | 213 base::WaitableEvent threads_waker_; |
214 | 214 |
215 // We don't want to use the default profile, but can't use UITest's since we | 215 // We don't want to use the default profile, but can't use UITest's since we |
216 // don't use UITest::LaunchBrowser. | 216 // don't use UITest::LaunchBrowser. |
217 ScopedTempDir temp_profile_dir_; | 217 ScopedTempDir temp_profile_dir_; |
218 }; | 218 }; |
219 | 219 |
220 #if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) | 220 #if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) |
221 // http://crbug.com/58219 | 221 // http://crbug.com/58219 |
222 #define MAYBE_StartupRaceCondition FAILS_StartupRaceCondition | 222 #define MAYBE_StartupRaceCondition DISABLED_StartupRaceCondition |
223 #else | 223 #else |
224 #define MAYBE_StartupRaceCondition StartupRaceCondition | 224 #define MAYBE_StartupRaceCondition StartupRaceCondition |
225 #endif | 225 #endif |
226 IN_PROC_BROWSER_TEST_F(ProcessSingletonTest, MAYBE_StartupRaceCondition) { | 226 IN_PROC_BROWSER_TEST_F(ProcessSingletonTest, MAYBE_StartupRaceCondition) { |
227 // We use this to stop the attempts loop on the first failure. | 227 // We use this to stop the attempts loop on the first failure. |
228 bool failed = false; | 228 bool failed = false; |
229 for (size_t attempt = 0; attempt < kNbAttempts && !failed; ++attempt) { | 229 for (size_t attempt = 0; attempt < kNbAttempts && !failed; ++attempt) { |
230 SCOPED_TRACE(testing::Message() << "Attempt: " << attempt << "."); | 230 SCOPED_TRACE(testing::Message() << "Attempt: " << attempt << "."); |
231 // We use a single event to get all threads to do the AppLaunch at the same | 231 // We use a single event to get all threads to do the AppLaunch at the same |
232 // time... | 232 // time... |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 ASSERT_EQ(static_cast<size_t>(1), pending_starters.size()); | 316 ASSERT_EQ(static_cast<size_t>(1), pending_starters.size()); |
317 size_t last_index = pending_starters.front(); | 317 size_t last_index = pending_starters.front(); |
318 pending_starters.clear(); | 318 pending_starters.clear(); |
319 if (chrome_starters_[last_index]->process_handle_ != | 319 if (chrome_starters_[last_index]->process_handle_ != |
320 base::kNullProcessHandle) { | 320 base::kNullProcessHandle) { |
321 KillProcessTree(chrome_starters_[last_index]->process_handle_); | 321 KillProcessTree(chrome_starters_[last_index]->process_handle_); |
322 chrome_starters_[last_index]->done_event_.Wait(); | 322 chrome_starters_[last_index]->done_event_.Wait(); |
323 } | 323 } |
324 } | 324 } |
325 } | 325 } |
OLD | NEW |