OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer/test_runner/web_test_proxy.h" | 5 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
6 | 6 |
7 #include <cctype> | 7 #include <cctype> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
17 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | |
18 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 17 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
19 #include "content/shell/renderer/test_runner/event_sender.h" | 18 #include "content/shell/renderer/test_runner/event_sender.h" |
20 #include "content/shell/renderer/test_runner/mock_color_chooser.h" | 19 #include "content/shell/renderer/test_runner/mock_color_chooser.h" |
21 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h" | 20 #include "content/shell/renderer/test_runner/mock_credential_manager_client.h" |
22 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" | 21 #include "content/shell/renderer/test_runner/mock_screen_orientation_client.h" |
23 #include "content/shell/renderer/test_runner/mock_web_push_client.h" | 22 #include "content/shell/renderer/test_runner/mock_web_push_client.h" |
24 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" | 23 #include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h" |
25 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" | 24 #include "content/shell/renderer/test_runner/mock_web_user_media_client.h" |
26 #include "content/shell/renderer/test_runner/spell_check_client.h" | 25 #include "content/shell/renderer/test_runner/spell_check_client.h" |
27 #include "content/shell/renderer/test_runner/test_interfaces.h" | 26 #include "content/shell/renderer/test_runner/test_interfaces.h" |
28 #include "content/shell/renderer/test_runner/test_plugin.h" | 27 #include "content/shell/renderer/test_runner/test_plugin.h" |
29 #include "content/shell/renderer/test_runner/test_runner.h" | 28 #include "content/shell/renderer/test_runner/test_runner.h" |
30 #include "content/shell/renderer/test_runner/web_test_delegate.h" | 29 #include "content/shell/renderer/test_runner/web_test_delegate.h" |
| 30 #include "content/shell/renderer/test_runner/web_test_interfaces.h" |
31 #include "content/shell/renderer/test_runner/web_test_runner.h" | 31 #include "content/shell/renderer/test_runner/web_test_runner.h" |
32 // FIXME: Including platform_canvas.h here is a layering violation. | 32 // FIXME: Including platform_canvas.h here is a layering violation. |
33 #include "skia/ext/platform_canvas.h" | 33 #include "skia/ext/platform_canvas.h" |
34 #include "third_party/WebKit/public/platform/Platform.h" | 34 #include "third_party/WebKit/public/platform/Platform.h" |
35 #include "third_party/WebKit/public/platform/WebCString.h" | 35 #include "third_party/WebKit/public/platform/WebCString.h" |
36 #include "third_party/WebKit/public/platform/WebClipboard.h" | 36 #include "third_party/WebKit/public/platform/WebClipboard.h" |
37 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" | 37 #include "third_party/WebKit/public/platform/WebCompositeAndReadbackAsyncCallbac
k.h" |
38 #include "third_party/WebKit/public/platform/WebURLError.h" | 38 #include "third_party/WebKit/public/platform/WebURLError.h" |
39 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 39 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
40 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 40 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 350 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
351 switches::kDisableSingleThreadProxyScheduler); | 351 switches::kDisableSingleThreadProxyScheduler); |
352 Reset(); | 352 Reset(); |
353 } | 353 } |
354 | 354 |
355 WebTestProxyBase::~WebTestProxyBase() { | 355 WebTestProxyBase::~WebTestProxyBase() { |
356 test_interfaces_->WindowClosed(this); | 356 test_interfaces_->WindowClosed(this); |
357 } | 357 } |
358 | 358 |
359 void WebTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) { | 359 void WebTestProxyBase::SetInterfaces(WebTestInterfaces* interfaces) { |
360 test_interfaces_ = interfaces->testInterfaces(); | 360 test_interfaces_ = interfaces->GetTestInterfaces(); |
361 test_interfaces_->WindowOpened(this); | 361 test_interfaces_->WindowOpened(this); |
362 } | 362 } |
363 | 363 |
364 void WebTestProxyBase::SetDelegate(WebTestDelegate* delegate) { | 364 void WebTestProxyBase::SetDelegate(WebTestDelegate* delegate) { |
365 delegate_ = delegate; | 365 delegate_ = delegate; |
366 spellcheck_->SetDelegate(delegate); | 366 spellcheck_->SetDelegate(delegate); |
367 if (speech_recognizer_.get()) | 367 if (speech_recognizer_.get()) |
368 speech_recognizer_->SetDelegate(delegate); | 368 speech_recognizer_->SetDelegate(delegate); |
369 } | 369 } |
370 | 370 |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 if (!push_client_.get()) | 1338 if (!push_client_.get()) |
1339 push_client_.reset(new MockWebPushClient); | 1339 push_client_.reset(new MockWebPushClient); |
1340 return push_client_.get(); | 1340 return push_client_.get(); |
1341 } | 1341 } |
1342 | 1342 |
1343 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { | 1343 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { |
1344 return GetPushClientMock(); | 1344 return GetPushClientMock(); |
1345 } | 1345 } |
1346 | 1346 |
1347 } // namespace content | 1347 } // namespace content |
OLD | NEW |