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 "content/public/test/browser_test_utils.h" | 5 #include "content/public/test/browser_test_utils.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 // In many cases, the load may have finished before we get here. Only wait if | 207 // In many cases, the load may have finished before we get here. Only wait if |
208 // the tab still has a pending navigation. | 208 // the tab still has a pending navigation. |
209 if (!web_contents->IsLoading()) | 209 if (!web_contents->IsLoading()) |
210 return; | 210 return; |
211 load_stop_observer.Wait(); | 211 load_stop_observer.Wait(); |
212 } | 212 } |
213 | 213 |
214 void CrashTab(WebContents* web_contents) { | 214 void CrashTab(WebContents* web_contents) { |
215 RenderProcessHost* rph = web_contents->GetRenderProcessHost(); | 215 RenderProcessHost* rph = web_contents->GetRenderProcessHost(); |
216 WindowedNotificationObserver observer( | 216 WindowedNotificationObserver observer( |
217 NOTIFICATION_RENDERER_PROCESS_CLOSED, | 217 NOTIFICATION_RENDERER_PROCESS_TERMINATED, |
ncarter (slow)
2013/11/12 03:38:26
Change this back to to NOTIFICATION_RENDERER_PROCE
Charlie Reis
2013/11/12 16:09:35
Done.
| |
218 Source<RenderProcessHost>(rph)); | 218 Source<RenderProcessHost>(rph)); |
219 LOG(INFO) << "CrashTab: Calling KillProcess."; | |
219 base::KillProcess(rph->GetHandle(), 0, false); | 220 base::KillProcess(rph->GetHandle(), 0, false); |
221 LOG(INFO) << "CrashTab: Waiting for process to exit..."; | |
220 observer.Wait(); | 222 observer.Wait(); |
221 } | 223 } |
222 | 224 |
223 void SimulateMouseClick(WebContents* web_contents, | 225 void SimulateMouseClick(WebContents* web_contents, |
224 int modifiers, | 226 int modifiers, |
225 WebKit::WebMouseEvent::Button button) { | 227 WebKit::WebMouseEvent::Button button) { |
226 int x = web_contents->GetView()->GetContainerSize().width() / 2; | 228 int x = web_contents->GetView()->GetContainerSize().width() / 2; |
227 int y = web_contents->GetView()->GetContainerSize().height() / 2; | 229 int y = web_contents->GetView()->GetContainerSize().height() / 2; |
228 SimulateMouseClickAt(web_contents, modifiers, button, gfx::Point(x, y)); | 230 SimulateMouseClickAt(web_contents, modifiers, button, gfx::Point(x, y)); |
229 } | 231 } |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
634 // The queue should not be empty, unless we were quit because of a timeout. | 636 // The queue should not be empty, unless we were quit because of a timeout. |
635 if (message_queue_.empty()) | 637 if (message_queue_.empty()) |
636 return false; | 638 return false; |
637 if (message) | 639 if (message) |
638 *message = message_queue_.front(); | 640 *message = message_queue_.front(); |
639 message_queue_.pop(); | 641 message_queue_.pop(); |
640 return true; | 642 return true; |
641 } | 643 } |
642 | 644 |
643 } // namespace content | 645 } // namespace content |
OLD | NEW |