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/layout_test/blink_test_controller.h" | 5 #include "content/shell/browser/layout_test/blink_test_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <iostream> | 9 #include <iostream> |
10 #include <set> | 10 #include <set> |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 IPC_MESSAGE_HANDLER(ShellViewHostMsg_InitiateLayoutDump, | 406 IPC_MESSAGE_HANDLER(ShellViewHostMsg_InitiateLayoutDump, |
407 OnInitiateLayoutDump) | 407 OnInitiateLayoutDump) |
408 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ImageDump, OnImageDump) | 408 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ImageDump, OnImageDump) |
409 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AudioDump, OnAudioDump) | 409 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AudioDump, OnAudioDump) |
410 IPC_MESSAGE_HANDLER(ShellViewHostMsg_OverridePreferences, | 410 IPC_MESSAGE_HANDLER(ShellViewHostMsg_OverridePreferences, |
411 OnOverridePreferences) | 411 OnOverridePreferences) |
412 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TestFinished, OnTestFinished) | 412 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TestFinished, OnTestFinished) |
413 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ClearDevToolsLocalStorage, | 413 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ClearDevToolsLocalStorage, |
414 OnClearDevToolsLocalStorage) | 414 OnClearDevToolsLocalStorage) |
415 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ShowDevTools, OnShowDevTools) | 415 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ShowDevTools, OnShowDevTools) |
416 IPC_MESSAGE_HANDLER(ShellViewHostMsg_EvaluateInDevTools, | |
417 OnEvaluateInDevTools) | |
418 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CloseDevTools, OnCloseDevTools) | 416 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CloseDevTools, OnCloseDevTools) |
419 IPC_MESSAGE_HANDLER(ShellViewHostMsg_GoToOffset, OnGoToOffset) | 417 IPC_MESSAGE_HANDLER(ShellViewHostMsg_GoToOffset, OnGoToOffset) |
420 IPC_MESSAGE_HANDLER(ShellViewHostMsg_Reload, OnReload) | 418 IPC_MESSAGE_HANDLER(ShellViewHostMsg_Reload, OnReload) |
421 IPC_MESSAGE_HANDLER(ShellViewHostMsg_LoadURLForFrame, OnLoadURLForFrame) | 419 IPC_MESSAGE_HANDLER(ShellViewHostMsg_LoadURLForFrame, OnLoadURLForFrame) |
422 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CaptureSessionHistory, | 420 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CaptureSessionHistory, |
423 OnCaptureSessionHistory) | 421 OnCaptureSessionHistory) |
424 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CloseRemainingWindows, | 422 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CloseRemainingWindows, |
425 OnCloseRemainingWindows) | 423 OnCloseRemainingWindows) |
426 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ResetDone, OnResetDone) | 424 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ResetDone, OnResetDone) |
427 IPC_MESSAGE_HANDLER(ShellViewHostMsg_LeakDetectionDone, OnLeakDetectionDone) | 425 IPC_MESSAGE_HANDLER(ShellViewHostMsg_LeakDetectionDone, OnLeakDetectionDone) |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 if (!devtools_frontend_) { | 758 if (!devtools_frontend_) { |
761 devtools_frontend_ = LayoutTestDevToolsFrontend::Show( | 759 devtools_frontend_ = LayoutTestDevToolsFrontend::Show( |
762 main_window_->web_contents(), settings, frontend_url); | 760 main_window_->web_contents(), settings, frontend_url); |
763 } else { | 761 } else { |
764 devtools_frontend_->ReuseFrontend(settings, frontend_url); | 762 devtools_frontend_->ReuseFrontend(settings, frontend_url); |
765 } | 763 } |
766 devtools_frontend_->Activate(); | 764 devtools_frontend_->Activate(); |
767 devtools_frontend_->Focus(); | 765 devtools_frontend_->Focus(); |
768 } | 766 } |
769 | 767 |
770 void BlinkTestController::OnEvaluateInDevTools( | |
771 int call_id, const std::string& script) { | |
772 if (devtools_frontend_) | |
773 devtools_frontend_->EvaluateInFrontend(call_id, script); | |
774 } | |
775 | |
776 void BlinkTestController::OnCloseDevTools() { | 768 void BlinkTestController::OnCloseDevTools() { |
777 if (devtools_frontend_) | 769 if (devtools_frontend_) |
778 devtools_frontend_->DisconnectFromTarget(); | 770 devtools_frontend_->DisconnectFromTarget(); |
779 } | 771 } |
780 | 772 |
781 void BlinkTestController::OnGoToOffset(int offset) { | 773 void BlinkTestController::OnGoToOffset(int offset) { |
782 main_window_->GoBackOrForward(offset); | 774 main_window_->GoBackOrForward(offset); |
783 } | 775 } |
784 | 776 |
785 void BlinkTestController::OnReload() { | 777 void BlinkTestController::OnReload() { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 } else { | 906 } else { |
915 printer_->AddErrorMessage(base::StringPrintf( | 907 printer_->AddErrorMessage(base::StringPrintf( |
916 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", | 908 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", |
917 event_name.c_str())); | 909 event_name.c_str())); |
918 return; | 910 return; |
919 } | 911 } |
920 bluetooth_chooser_factory_->SendEvent(event, argument); | 912 bluetooth_chooser_factory_->SendEvent(event, argument); |
921 } | 913 } |
922 | 914 |
923 } // namespace content | 915 } // namespace content |
OLD | NEW |