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/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 Loading... |
65 #elif defined(OS_MACOSX) | 65 #elif defined(OS_MACOSX) |
66 #include "base/mac/mac_util.h" | 66 #include "base/mac/mac_util.h" |
67 #endif | 67 #endif |
68 | 68 |
69 using WebKit::WebLayerTreeViewImplForTesting; | 69 using WebKit::WebLayerTreeViewImplForTesting; |
70 using WebKit::WebScriptController; | 70 using WebKit::WebScriptController; |
71 | 71 |
72 TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode, | 72 TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode, |
73 WebKit::Platform* shadow_platform_delegate) | 73 WebKit::Platform* shadow_platform_delegate) |
74 : unit_test_mode_(unit_test_mode), | 74 : unit_test_mode_(unit_test_mode), |
75 shadow_platform_delegate_(shadow_platform_delegate) { | 75 shadow_platform_delegate_(shadow_platform_delegate), |
| 76 threaded_compositing_enabled_(false) { |
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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 return NULL; | 407 return NULL; |
407 return main_thread_contexts_->GrContext(); | 408 return main_thread_contexts_->GrContext(); |
408 } | 409 } |
409 | 410 |
410 bool TestWebKitPlatformSupport::canAccelerate2dCanvas() { | 411 bool TestWebKitPlatformSupport::canAccelerate2dCanvas() { |
411 // We supply an OS-MESA based context for accelarated 2d | 412 // We supply an OS-MESA based context for accelarated 2d |
412 // canvas, which should always work. | 413 // canvas, which should always work. |
413 return true; | 414 return true; |
414 } | 415 } |
415 | 416 |
| 417 bool TestWebKitPlatformSupport::isThreadedCompositingEnabled() { |
| 418 return threaded_compositing_enabled_; |
| 419 } |
| 420 |
416 double TestWebKitPlatformSupport::audioHardwareSampleRate() { | 421 double TestWebKitPlatformSupport::audioHardwareSampleRate() { |
417 return 44100.0; | 422 return 44100.0; |
418 } | 423 } |
419 | 424 |
420 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() { | 425 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() { |
421 return 128; | 426 return 128; |
422 } | 427 } |
423 | 428 |
424 WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice( | 429 WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice( |
425 size_t bufferSize, unsigned numberOfInputChannels, | 430 size_t bufferSize, unsigned numberOfInputChannels, |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 return view.release(); | 580 return view.release(); |
576 } | 581 } |
577 | 582 |
578 WebKit::WebLayerTreeView* | 583 WebKit::WebLayerTreeView* |
579 TestWebKitPlatformSupport::createLayerTreeViewForTesting( | 584 TestWebKitPlatformSupport::createLayerTreeViewForTesting( |
580 TestViewType type) { | 585 TestViewType type) { |
581 DCHECK_EQ(TestViewTypeUnitTest, type); | 586 DCHECK_EQ(TestViewTypeUnitTest, type); |
582 return createLayerTreeViewForTesting(); | 587 return createLayerTreeViewForTesting(); |
583 } | 588 } |
584 | 589 |
OLD | NEW |