OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/support/test_webkit_platform_support.h" | 5 #include "webkit/support/test_webkit_platform_support.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/metrics/stats_counters.h" | 8 #include "base/metrics/stats_counters.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/win/WebTheme
Engine.h" | 61 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/win/WebTheme
Engine.h" |
62 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" | 62 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" |
63 #elif defined(OS_MACOSX) | 63 #elif defined(OS_MACOSX) |
64 #include "base/mac/mac_util.h" | 64 #include "base/mac/mac_util.h" |
65 #elif defined(OS_POSIX) && !defined(OS_ANDROID) | 65 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
66 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebThe
meEngine.h" | 66 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebThe
meEngine.h" |
67 #endif | 67 #endif |
68 | 68 |
69 using WebKit::WebScriptController; | 69 using WebKit::WebScriptController; |
70 | 70 |
71 TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode) | 71 TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode, |
72 : unit_test_mode_(unit_test_mode) { | 72 WebKit::Platform* shadow_platform_delegate) |
| 73 : unit_test_mode_(unit_test_mode), |
| 74 shadow_platform_delegate_(shadow_platform_delegate) { |
73 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); | 75 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); |
74 | 76 |
75 WebKit::initialize(this); | 77 WebKit::initialize(this); |
76 WebKit::setLayoutTestMode(true); | 78 WebKit::setLayoutTestMode(true); |
77 WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( | 79 WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( |
78 WebKit::WebString::fromUTF8("test-shell-resource")); | 80 WebKit::WebString::fromUTF8("test-shell-resource")); |
79 WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess( | 81 WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess( |
80 WebKit::WebString::fromUTF8("test-shell-resource")); | 82 WebKit::WebString::fromUTF8("test-shell-resource")); |
81 WebKit::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( | 83 WebKit::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( |
82 WebKit::WebString::fromUTF8("test-shell-resource")); | 84 WebKit::WebString::fromUTF8("test-shell-resource")); |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { | 492 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
491 return SimpleResourceLoaderBridge::Create(request_info); | 493 return SimpleResourceLoaderBridge::Create(request_info); |
492 } | 494 } |
493 | 495 |
494 webkit_glue::WebSocketStreamHandleBridge* | 496 webkit_glue::WebSocketStreamHandleBridge* |
495 TestWebKitPlatformSupport::CreateWebSocketBridge( | 497 TestWebKitPlatformSupport::CreateWebSocketBridge( |
496 WebKit::WebSocketStreamHandle* handle, | 498 WebKit::WebSocketStreamHandle* handle, |
497 webkit_glue::WebSocketStreamHandleDelegate* delegate) { | 499 webkit_glue::WebSocketStreamHandleDelegate* delegate) { |
498 return SimpleSocketStreamBridge::Create(handle, delegate); | 500 return SimpleSocketStreamBridge::Create(handle, delegate); |
499 } | 501 } |
| 502 |
| 503 WebKit::WebMediaStreamCenter* |
| 504 TestWebKitPlatformSupport::createMediaStreamCenter( |
| 505 WebKit::WebMediaStreamCenterClient* client) { |
| 506 if (shadow_platform_delegate_) |
| 507 return shadow_platform_delegate_->createMediaStreamCenter(client); |
| 508 else |
| 509 return webkit_glue::WebKitPlatformSupportImpl::createMediaStreamCenter( |
| 510 client); |
| 511 } |
OLD | NEW |