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 24 matching lines...) Expand all Loading... | |
35 #include "content/public/browser/render_widget_host.h" | 35 #include "content/public/browser/render_widget_host.h" |
36 #include "content/public/browser/render_widget_host_view.h" | 36 #include "content/public/browser/render_widget_host_view.h" |
37 #include "content/public/browser/service_worker_context.h" | 37 #include "content/public/browser/service_worker_context.h" |
38 #include "content/public/browser/storage_partition.h" | 38 #include "content/public/browser/storage_partition.h" |
39 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
40 #include "content/public/common/bindings_policy.h" | 40 #include "content/public/common/bindings_policy.h" |
41 #include "content/public/common/content_switches.h" | 41 #include "content/public/common/content_switches.h" |
42 #include "content/public/common/url_constants.h" | 42 #include "content/public/common/url_constants.h" |
43 #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factor y.h" | 43 #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factor y.h" |
44 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" | 44 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" |
45 #include "content/shell/browser/layout_test/layout_test_first_device_bluetooth_c hooser.h" | |
45 #include "content/shell/browser/shell.h" | 46 #include "content/shell/browser/shell.h" |
46 #include "content/shell/browser/shell_browser_context.h" | 47 #include "content/shell/browser/shell_browser_context.h" |
47 #include "content/shell/browser/shell_content_browser_client.h" | 48 #include "content/shell/browser/shell_content_browser_client.h" |
48 #include "content/shell/browser/shell_devtools_frontend.h" | 49 #include "content/shell/browser/shell_devtools_frontend.h" |
49 #include "content/shell/common/layout_test/layout_test_messages.h" | 50 #include "content/shell/common/layout_test/layout_test_messages.h" |
50 #include "content/shell/common/layout_test/layout_test_switches.h" | 51 #include "content/shell/common/layout_test/layout_test_switches.h" |
51 #include "content/shell/common/shell_messages.h" | 52 #include "content/shell/common/shell_messages.h" |
52 #include "content/shell/renderer/layout_test/blink_test_helpers.h" | 53 #include "content/shell/renderer/layout_test/blink_test_helpers.h" |
53 #include "ui/gfx/codec/png_codec.h" | 54 #include "ui/gfx/codec/png_codec.h" |
54 | 55 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
385 RenderViewHost* main_render_view_host = | 386 RenderViewHost* main_render_view_host = |
386 main_window_->web_contents()->GetRenderViewHost(); | 387 main_window_->web_contents()->GetRenderViewHost(); |
387 main_render_view_host->Send(new ShellViewMsg_TestFinishedInSecondaryRenderer( | 388 main_render_view_host->Send(new ShellViewMsg_TestFinishedInSecondaryRenderer( |
388 main_render_view_host->GetRoutingID())); | 389 main_render_view_host->GetRoutingID())); |
389 } | 390 } |
390 | 391 |
391 bool BlinkTestController::IsMainWindow(WebContents* web_contents) const { | 392 bool BlinkTestController::IsMainWindow(WebContents* web_contents) const { |
392 return main_window_ && web_contents == main_window_->web_contents(); | 393 return main_window_ && web_contents == main_window_->web_contents(); |
393 } | 394 } |
394 | 395 |
395 std::unique_ptr<BluetoothChooser> BlinkTestController::RunBluetoothChooser( | 396 std::unique_ptr<BluetoothChooser> BlinkTestController::RunBluetoothChooser( |
scheib
2016/06/30 22:18:11
Out of scope of this change, but why isn't this 'G
ortuno
2016/06/30 22:32:36
Not sure... It was added a long time ago and no on
| |
396 RenderFrameHost* frame, | 397 RenderFrameHost* frame, |
397 const BluetoothChooser::EventHandler& event_handler) { | 398 const BluetoothChooser::EventHandler& event_handler) { |
398 if (bluetooth_chooser_factory_) { | 399 if (bluetooth_chooser_factory_) { |
399 return bluetooth_chooser_factory_->RunBluetoothChooser(frame, | 400 return bluetooth_chooser_factory_->RunBluetoothChooser(frame, |
400 event_handler); | 401 event_handler); |
401 } | 402 } |
402 return nullptr; | 403 return base::MakeUnique<LayoutTestFirstDeviceBluetoothChooser>(event_handler); |
403 } | 404 } |
404 | 405 |
405 bool BlinkTestController::OnMessageReceived(const IPC::Message& message) { | 406 bool BlinkTestController::OnMessageReceived(const IPC::Message& message) { |
406 DCHECK(CalledOnValidThread()); | 407 DCHECK(CalledOnValidThread()); |
407 bool handled = true; | 408 bool handled = true; |
408 IPC_BEGIN_MESSAGE_MAP(BlinkTestController, message) | 409 IPC_BEGIN_MESSAGE_MAP(BlinkTestController, message) |
409 IPC_MESSAGE_HANDLER(ShellViewHostMsg_PrintMessage, OnPrintMessage) | 410 IPC_MESSAGE_HANDLER(ShellViewHostMsg_PrintMessage, OnPrintMessage) |
410 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TextDump, OnTextDump) | 411 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TextDump, OnTextDump) |
411 IPC_MESSAGE_HANDLER(ShellViewHostMsg_InitiateLayoutDump, | 412 IPC_MESSAGE_HANDLER(ShellViewHostMsg_InitiateLayoutDump, |
412 OnInitiateLayoutDump) | 413 OnInitiateLayoutDump) |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
927 } else { | 928 } else { |
928 printer_->AddErrorMessage(base::StringPrintf( | 929 printer_->AddErrorMessage(base::StringPrintf( |
929 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", | 930 "FAIL: Unexpected sendBluetoothManualChooserEvent() event name '%s'.", |
930 event_name.c_str())); | 931 event_name.c_str())); |
931 return; | 932 return; |
932 } | 933 } |
933 bluetooth_chooser_factory_->SendEvent(event, argument); | 934 bluetooth_chooser_factory_->SendEvent(event, argument); |
934 } | 935 } |
935 | 936 |
936 } // namespace content | 937 } // namespace content |
OLD | NEW |