Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: webkit/support/test_webkit_platform_support.cc

Issue 14682023: Add plumbing for testing API for MockWebDeviceMotionHandler injection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: plumbing without the WebDeviceMotionProvider Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/metrics/stats_counters.h" 10 #include "base/metrics/stats_counters.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "base/mac/mac_util.h" 65 #include "base/mac/mac_util.h"
66 #endif 66 #endif
67 67
68 using WebKit::WebScriptController; 68 using WebKit::WebScriptController;
69 using webkit::WebLayerTreeViewImplForTesting; 69 using webkit::WebLayerTreeViewImplForTesting;
70 70
71 TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode, 71 TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode,
72 WebKit::Platform* shadow_platform_delegate) 72 WebKit::Platform* shadow_platform_delegate)
73 : unit_test_mode_(unit_test_mode), 73 : unit_test_mode_(unit_test_mode),
74 shadow_platform_delegate_(shadow_platform_delegate), 74 shadow_platform_delegate_(shadow_platform_delegate),
75 threaded_compositing_enabled_(false) { 75 threaded_compositing_enabled_(false),
76 device_motion_listener_(0) {
76 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); 77 v8::V8::SetCounterFunction(base::StatsTable::FindLocation);
77 78
78 WebKit::initialize(this); 79 WebKit::initialize(this);
79 WebKit::setLayoutTestMode(true); 80 WebKit::setLayoutTestMode(true);
80 WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( 81 WebKit::WebSecurityPolicy::registerURLSchemeAsLocal(
81 WebKit::WebString::fromUTF8("test-shell-resource")); 82 WebKit::WebString::fromUTF8("test-shell-resource"));
82 WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess( 83 WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess(
83 WebKit::WebString::fromUTF8("test-shell-resource")); 84 WebKit::WebString::fromUTF8("test-shell-resource"));
84 WebKit::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( 85 WebKit::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(
85 WebKit::WebString::fromUTF8("test-shell-resource")); 86 WebKit::WebString::fromUTF8("test-shell-resource"));
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 451
451 void TestWebKitPlatformSupport::sampleGamepads(WebKit::WebGamepads& data) { 452 void TestWebKitPlatformSupport::sampleGamepads(WebKit::WebGamepads& data) {
452 data = gamepad_data_; 453 data = gamepad_data_;
453 } 454 }
454 455
455 void TestWebKitPlatformSupport::setGamepadData( 456 void TestWebKitPlatformSupport::setGamepadData(
456 const WebKit::WebGamepads& data) { 457 const WebKit::WebGamepads& data) {
457 gamepad_data_ = data; 458 gamepad_data_ = data;
458 } 459 }
459 460
461 void TestWebKitPlatformSupport::setDeviceMotionListener(
462 WebKit::WebDeviceMotionListener* listener) {
463 device_motion_listener_ = listener;
464 }
465
460 void TestWebKitPlatformSupport::GetPlugins( 466 void TestWebKitPlatformSupport::GetPlugins(
461 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { 467 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) {
462 if (refresh) 468 if (refresh)
463 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); 469 webkit::npapi::PluginList::Singleton()->RefreshPlugins();
464 webkit::npapi::PluginList::Singleton()->GetPlugins(plugins); 470 webkit::npapi::PluginList::Singleton()->GetPlugins(plugins);
465 } 471 }
466 472
467 webkit_glue::ResourceLoaderBridge* 473 webkit_glue::ResourceLoaderBridge*
468 TestWebKitPlatformSupport::CreateResourceLoader( 474 TestWebKitPlatformSupport::CreateResourceLoader(
469 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { 475 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 return view.release(); 557 return view.release();
552 } 558 }
553 559
554 WebKit::WebLayerTreeView* 560 WebKit::WebLayerTreeView*
555 TestWebKitPlatformSupport::createLayerTreeViewForTesting( 561 TestWebKitPlatformSupport::createLayerTreeViewForTesting(
556 TestViewType type) { 562 TestViewType type) {
557 DCHECK_EQ(TestViewTypeUnitTest, type); 563 DCHECK_EQ(TestViewTypeUnitTest, type);
558 return createLayerTreeViewForTesting(); 564 return createLayerTreeViewForTesting();
559 } 565 }
560 566
OLDNEW
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698