OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 base::kNullProcessHandle) { | 308 base::kNullProcessHandle) { |
309 KillProcessTree(chrome_starters_[starter_index]->process_handle_); | 309 KillProcessTree(chrome_starters_[starter_index]->process_handle_); |
310 } | 310 } |
311 } | 311 } |
312 pending_starters.erase(pending_starters.begin() + done_index); | 312 pending_starters.erase(pending_starters.begin() + done_index); |
313 } | 313 } |
314 | 314 |
315 // "There can be only one!" :-) | 315 // "There can be only one!" :-) |
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.empty(); | 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 } |
326 | 326 |
327 } // namespace | 327 } // namespace |
OLD | NEW |