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 return bluetooth_chooser_factory_->RunBluetoothChooser(frame, | 406 return bluetooth_chooser_factory_->RunBluetoothChooser(frame, |
407 event_handler); | 407 event_handler); |
408 } | 408 } |
409 return base::MakeUnique<LayoutTestFirstDeviceBluetoothChooser>(event_handler); | 409 return base::MakeUnique<LayoutTestFirstDeviceBluetoothChooser>(event_handler); |
410 } | 410 } |
411 | 411 |
412 bool BlinkTestController::OnMessageReceived(const IPC::Message& message) { | 412 bool BlinkTestController::OnMessageReceived(const IPC::Message& message) { |
413 DCHECK(CalledOnValidThread()); | 413 DCHECK(CalledOnValidThread()); |
414 bool handled = true; | 414 bool handled = true; |
415 IPC_BEGIN_MESSAGE_MAP(BlinkTestController, message) | 415 IPC_BEGIN_MESSAGE_MAP(BlinkTestController, message) |
416 IPC_MESSAGE_HANDLER(ShellViewHostMsg_PrintMessage, OnPrintMessage) | |
417 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TextDump, OnTextDump) | 416 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TextDump, OnTextDump) |
418 IPC_MESSAGE_HANDLER(ShellViewHostMsg_InitiateLayoutDump, | 417 IPC_MESSAGE_HANDLER(ShellViewHostMsg_InitiateLayoutDump, |
419 OnInitiateLayoutDump) | 418 OnInitiateLayoutDump) |
420 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ImageDump, OnImageDump) | 419 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ImageDump, OnImageDump) |
421 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AudioDump, OnAudioDump) | 420 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AudioDump, OnAudioDump) |
422 IPC_MESSAGE_HANDLER(ShellViewHostMsg_OverridePreferences, | 421 IPC_MESSAGE_HANDLER(ShellViewHostMsg_OverridePreferences, |
423 OnOverridePreferences) | 422 OnOverridePreferences) |
424 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TestFinished, OnTestFinished) | 423 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TestFinished, OnTestFinished) |
425 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ClearDevToolsLocalStorage, | 424 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ClearDevToolsLocalStorage, |
426 OnClearDevToolsLocalStorage) | 425 OnClearDevToolsLocalStorage) |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 } | 750 } |
752 | 751 |
753 // Continue finishing the test. | 752 // Continue finishing the test. |
754 RenderViewHost* render_view_host = | 753 RenderViewHost* render_view_host = |
755 main_window_->web_contents()->GetRenderViewHost(); | 754 main_window_->web_contents()->GetRenderViewHost(); |
756 render_view_host->Send(new ShellViewMsg_LayoutDumpCompleted( | 755 render_view_host->Send(new ShellViewMsg_LayoutDumpCompleted( |
757 render_view_host->GetRoutingID(), stitched_layout_dump)); | 756 render_view_host->GetRoutingID(), stitched_layout_dump)); |
758 } | 757 } |
759 | 758 |
760 void BlinkTestController::OnPrintMessage(const std::string& message) { | 759 void BlinkTestController::OnPrintMessage(const std::string& message) { |
| 760 DCHECK(CalledOnValidThread()); |
761 printer_->AddMessageRaw(message); | 761 printer_->AddMessageRaw(message); |
762 } | 762 } |
763 | 763 |
764 void BlinkTestController::OnOverridePreferences(const WebPreferences& prefs) { | 764 void BlinkTestController::OnOverridePreferences(const WebPreferences& prefs) { |
765 should_override_prefs_ = true; | 765 should_override_prefs_ = true; |
766 prefs_ = prefs; | 766 prefs_ = prefs; |
767 | 767 |
768 // Notifies the main RenderViewHost that Blink preferences changed so | 768 // Notifies the main RenderViewHost that Blink preferences changed so |
769 // immediately apply the new settings and to avoid re-usage of cached | 769 // immediately apply the new settings and to avoid re-usage of cached |
770 // preferences that are now stale. RenderViewHost::UpdateWebkitPreferences is | 770 // preferences that are now stale. RenderViewHost::UpdateWebkitPreferences is |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 } else { | 944 } else { |
945 printer_->AddErrorMessage(base::StringPrintf( | 945 printer_->AddErrorMessage(base::StringPrintf( |
946 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", | 946 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", |
947 event_name.c_str())); | 947 event_name.c_str())); |
948 return; | 948 return; |
949 } | 949 } |
950 bluetooth_chooser_factory_->SendEvent(event, argument); | 950 bluetooth_chooser_factory_->SendEvent(event, argument); |
951 } | 951 } |
952 | 952 |
953 } // namespace content | 953 } // namespace content |
OLD | NEW |