OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shell/browser/webkit_test_controller.h" | 5 #include "content/shell/browser/webkit_test_controller.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CloseDevTools, OnCloseDevTools) | 382 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CloseDevTools, OnCloseDevTools) |
383 IPC_MESSAGE_HANDLER(ShellViewHostMsg_GoToOffset, OnGoToOffset) | 383 IPC_MESSAGE_HANDLER(ShellViewHostMsg_GoToOffset, OnGoToOffset) |
384 IPC_MESSAGE_HANDLER(ShellViewHostMsg_Reload, OnReload) | 384 IPC_MESSAGE_HANDLER(ShellViewHostMsg_Reload, OnReload) |
385 IPC_MESSAGE_HANDLER(ShellViewHostMsg_LoadURLForFrame, OnLoadURLForFrame) | 385 IPC_MESSAGE_HANDLER(ShellViewHostMsg_LoadURLForFrame, OnLoadURLForFrame) |
386 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CaptureSessionHistory, | 386 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CaptureSessionHistory, |
387 OnCaptureSessionHistory) | 387 OnCaptureSessionHistory) |
388 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CloseRemainingWindows, | 388 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CloseRemainingWindows, |
389 OnCloseRemainingWindows) | 389 OnCloseRemainingWindows) |
390 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ResetDone, OnResetDone) | 390 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ResetDone, OnResetDone) |
391 IPC_MESSAGE_HANDLER(ShellViewHostMsg_LeakDetectionDone, OnLeakDetectionDone) | 391 IPC_MESSAGE_HANDLER(ShellViewHostMsg_LeakDetectionDone, OnLeakDetectionDone) |
| 392 IPC_MESSAGE_HANDLER(ShellViewHostMsg_EchoPing, OnEchoPing) |
392 IPC_MESSAGE_UNHANDLED(handled = false) | 393 IPC_MESSAGE_UNHANDLED(handled = false) |
393 IPC_END_MESSAGE_MAP() | 394 IPC_END_MESSAGE_MAP() |
394 | 395 |
395 return handled; | 396 return handled; |
396 } | 397 } |
397 | 398 |
398 void WebKitTestController::PluginCrashed(const base::FilePath& plugin_path, | 399 void WebKitTestController::PluginCrashed(const base::FilePath& plugin_path, |
399 base::ProcessId plugin_pid) { | 400 base::ProcessId plugin_pid) { |
400 DCHECK(CalledOnValidThread()); | 401 DCHECK(CalledOnValidThread()); |
401 printer_->AddErrorMessage( | 402 printer_->AddErrorMessage( |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 } | 687 } |
687 | 688 |
688 printer_->AddErrorMessage( | 689 printer_->AddErrorMessage( |
689 base::StringPrintf("#LEAK - renderer pid %d (%s)", current_pid_, | 690 base::StringPrintf("#LEAK - renderer pid %d (%s)", current_pid_, |
690 result.detail.c_str())); | 691 result.detail.c_str())); |
691 CHECK(!crash_when_leak_found_); | 692 CHECK(!crash_when_leak_found_); |
692 | 693 |
693 DiscardMainWindow(); | 694 DiscardMainWindow(); |
694 } | 695 } |
695 | 696 |
| 697 void WebKitTestController::OnEchoPing(int id, const std::string& body) { |
| 698 if (main_window_ && main_window_->web_contents()) { |
| 699 RenderViewHost* render_view_host = |
| 700 main_window_->web_contents()->GetRenderViewHost(); |
| 701 render_view_host->Send( |
| 702 new ShellViewMsg_EchoPong(render_view_host->GetRoutingID(), id, body)); |
| 703 } |
| 704 } |
| 705 |
| 706 |
696 } // namespace content | 707 } // namespace content |
OLD | NEW |