OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/process_singleton.h" | 5 #include "chrome/browser/process_singleton.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Drop the process finder notification timeout to one second for testing. | 154 // Drop the process finder notification timeout to one second for testing. |
155 old_notification_timeout_ = chrome::SetNotificationTimeoutForTesting( | 155 old_notification_timeout_ = chrome::SetNotificationTimeoutForTesting( |
156 base::TimeDelta::FromSeconds(1)); | 156 base::TimeDelta::FromSeconds(1)); |
157 } | 157 } |
158 | 158 |
159 void TearDown() override { | 159 void TearDown() override { |
160 chrome::SetNotificationTimeoutForTesting(old_notification_timeout_); | 160 chrome::SetNotificationTimeoutForTesting(old_notification_timeout_); |
161 | 161 |
162 if (browser_victim_.IsValid()) { | 162 if (browser_victim_.IsValid()) { |
163 EXPECT_TRUE(::SetEvent(continue_event_.Get())); | 163 EXPECT_TRUE(::SetEvent(continue_event_.Get())); |
164 int exit_code = 0; | 164 EXPECT_TRUE(browser_victim_.WaitForExit(nullptr)); |
165 EXPECT_TRUE(browser_victim_.WaitForExit(&exit_code)); | |
166 } | 165 } |
167 | 166 |
168 base::MultiProcessTest::TearDown(); | 167 base::MultiProcessTest::TearDown(); |
169 } | 168 } |
170 | 169 |
171 void LaunchHungBrowserProcess(WindowOption window_option) { | 170 void LaunchHungBrowserProcess(WindowOption window_option) { |
172 // Create a unique user data dir to rendezvous on. | 171 // Create a unique user data dir to rendezvous on. |
173 ASSERT_TRUE(user_data_dir_.CreateUniqueTempDir()); | 172 ASSERT_TRUE(user_data_dir_.CreateUniqueTempDir()); |
174 | 173 |
175 // Create the named "ready" event, this is unique to our process. | 174 // Create the named "ready" event, this is unique to our process. |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // visible window. | 308 // visible window. |
310 EXPECT_TRUE(should_kill_called()); | 309 EXPECT_TRUE(should_kill_called()); |
311 | 310 |
312 // Verify that the hung browser has beem terminated with the | 311 // Verify that the hung browser has beem terminated with the |
313 // RESULT_CODE_HUNG exit code. | 312 // RESULT_CODE_HUNG exit code. |
314 int exit_code = 0; | 313 int exit_code = 0; |
315 EXPECT_TRUE( | 314 EXPECT_TRUE( |
316 browser_victim()->WaitForExitWithTimeout(base::TimeDelta(), &exit_code)); | 315 browser_victim()->WaitForExitWithTimeout(base::TimeDelta(), &exit_code)); |
317 EXPECT_EQ(content::RESULT_CODE_HUNG, exit_code); | 316 EXPECT_EQ(content::RESULT_CODE_HUNG, exit_code); |
318 } | 317 } |
OLD | NEW |