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/memory/scoped_handle.h" | 10 #include "base/memory/scoped_handle.h" |
11 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "cc/context_provider.h" |
15 #include "cc/thread_impl.h" | 16 #include "cc/thread_impl.h" |
16 #include "media/base/media.h" | 17 #include "media/base/media.h" |
17 #include "net/cookies/cookie_monster.h" | 18 #include "net/cookies/cookie_monster.h" |
18 #include "net/http/http_cache.h" | 19 #include "net/http/http_cache.h" |
19 #include "net/test/test_server.h" | 20 #include "net/test/test_server.h" |
20 #include "third_party/WebKit/Source/Platform/chromium/public/WebAudioDevice.h" | 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebAudioDevice.h" |
21 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" | 22 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" |
22 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystem.h" | 23 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystem.h" |
23 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h" | 24 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h" |
24 #include "third_party/WebKit/Source/Platform/chromium/public/WebStorageArea.h" | 25 #include "third_party/WebKit/Source/Platform/chromium/public/WebStorageArea.h" |
25 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 26 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
26 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" | 27 #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" |
33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" |
34 #include "third_party/hyphen/hyphen.h" | 35 #include "third_party/hyphen/hyphen.h" |
35 #include "v8/include/v8.h" | 36 #include "v8/include/v8.h" |
36 #include "webkit/appcache/web_application_cache_host_impl.h" | 37 #include "webkit/appcache/web_application_cache_host_impl.h" |
37 #include "webkit/compositor_bindings/web_compositor_support_impl.h" | 38 #include "webkit/compositor_bindings/web_compositor_support_impl.h" |
38 #include "webkit/compositor_bindings/web_layer_tree_view_impl_for_testing.h" | 39 #include "webkit/compositor_bindings/web_layer_tree_view_impl_for_testing.h" |
39 #include "webkit/database/vfs_backend.h" | 40 #include "webkit/database/vfs_backend.h" |
40 #include "webkit/glue/simple_webmimeregistry_impl.h" | 41 #include "webkit/glue/simple_webmimeregistry_impl.h" |
41 #include "webkit/glue/webclipboard_impl.h" | 42 #include "webkit/glue/webclipboard_impl.h" |
42 #include "webkit/glue/webkit_glue.h" | 43 #include "webkit/glue/webkit_glue.h" |
43 #include "webkit/glue/webkitplatformsupport_impl.h" | 44 #include "webkit/glue/webkitplatformsupport_impl.h" |
| 45 #include "webkit/gpu/test_context_provider_factory.h" |
44 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 46 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
45 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 47 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
46 #include "webkit/plugins/npapi/plugin_list.h" | 48 #include "webkit/plugins/npapi/plugin_list.h" |
47 #include "webkit/support/gc_extension.h" | 49 #include "webkit/support/gc_extension.h" |
48 #include "webkit/support/simple_database_system.h" | 50 #include "webkit/support/simple_database_system.h" |
49 #include "webkit/support/test_webmessageportchannel.h" | 51 #include "webkit/support/test_webmessageportchannel.h" |
50 #include "webkit/support/web_audio_device_mock.h" | 52 #include "webkit/support/web_audio_device_mock.h" |
51 #include "webkit/support/web_gesture_curve_mock.h" | 53 #include "webkit/support/web_gesture_curve_mock.h" |
52 #include "webkit/support/webkit_support.h" | 54 #include "webkit/support/webkit_support.h" |
53 #include "webkit/support/weburl_loader_mock_factory.h" | 55 #include "webkit/support/weburl_loader_mock_factory.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); | 373 webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl()); |
372 if (!context->Initialize(attributes, NULL)) | 374 if (!context->Initialize(attributes, NULL)) |
373 return NULL; | 375 return NULL; |
374 return context.release(); | 376 return context.release(); |
375 } | 377 } |
376 } | 378 } |
377 NOTREACHED(); | 379 NOTREACHED(); |
378 return NULL; | 380 return NULL; |
379 } | 381 } |
380 | 382 |
| 383 WebKit::WebGraphicsContext3D* |
| 384 TestWebKitPlatformSupport::sharedOffscreenGraphicsContext3D() { |
| 385 main_thread_contexts_ = |
| 386 webkit::gpu::TestContextProviderFactory::GetInstance()-> |
| 387 OffscreenContextProviderForMainThread(); |
| 388 if (!main_thread_contexts_->InitializeOnMainThread()) |
| 389 return NULL; |
| 390 if (!main_thread_contexts_->BindToCurrentThread()) |
| 391 return NULL; |
| 392 return main_thread_contexts_->Context3d(); |
| 393 } |
| 394 |
| 395 GrContext* TestWebKitPlatformSupport::sharedOffscreenGrContext() { |
| 396 if (!main_thread_contexts_) |
| 397 return NULL; |
| 398 return main_thread_contexts_->GrContext(); |
| 399 } |
| 400 |
381 bool TestWebKitPlatformSupport::canAccelerate2dCanvas() { | 401 bool TestWebKitPlatformSupport::canAccelerate2dCanvas() { |
382 // We supply an OS-MESA based context for accelarated 2d | 402 // We supply an OS-MESA based context for accelarated 2d |
383 // canvas, which should always work. | 403 // canvas, which should always work. |
384 return true; | 404 return true; |
385 } | 405 } |
386 | 406 |
387 double TestWebKitPlatformSupport::audioHardwareSampleRate() { | 407 double TestWebKitPlatformSupport::audioHardwareSampleRate() { |
388 return 44100.0; | 408 return 44100.0; |
389 } | 409 } |
390 | 410 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 return view.release(); | 632 return view.release(); |
613 } | 633 } |
614 | 634 |
615 WebKit::WebLayerTreeView* | 635 WebKit::WebLayerTreeView* |
616 TestWebKitPlatformSupport::createLayerTreeViewForTesting( | 636 TestWebKitPlatformSupport::createLayerTreeViewForTesting( |
617 TestViewType type) { | 637 TestViewType type) { |
618 DCHECK_EQ(TestViewTypeUnitTest, type); | 638 DCHECK_EQ(TestViewTypeUnitTest, type); |
619 return createLayerTreeViewForTesting(); | 639 return createLayerTreeViewForTesting(); |
620 } | 640 } |
621 | 641 |
OLD | NEW |