OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_ | 5 #ifndef CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_ |
6 #define CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_ | 6 #define CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "cc/blink/web_compositor_support_impl.h" | 14 #include "cc/blink/web_compositor_support_impl.h" |
15 #include "content/child/blink_platform_impl.h" | 15 #include "content/child/blink_platform_impl.h" |
16 #include "content/child/simple_webmimeregistry_impl.h" | |
17 #include "content/child/webfileutilities_impl.h" | 16 #include "content/child/webfileutilities_impl.h" |
18 #include "content/test/mock_webblob_registry_impl.h" | 17 #include "content/test/mock_webblob_registry_impl.h" |
19 #include "content/test/mock_webclipboard_impl.h" | 18 #include "content/test/mock_webclipboard_impl.h" |
20 #include "third_party/WebKit/public/platform/WebURLLoaderMockFactory.h" | 19 #include "third_party/WebKit/public/platform/WebURLLoaderMockFactory.h" |
21 | 20 |
22 namespace blink { | 21 namespace blink { |
23 namespace scheduler { | 22 namespace scheduler { |
24 class RendererScheduler; | 23 class RendererScheduler; |
25 } | 24 } |
26 } | 25 } |
27 | 26 |
28 namespace cc { | 27 namespace cc { |
29 class TestSharedBitmapManager; | 28 class TestSharedBitmapManager; |
30 } | 29 } |
31 | 30 |
32 namespace content { | 31 namespace content { |
33 | 32 |
34 // An implementation of BlinkPlatformImpl for tests. | 33 // An implementation of BlinkPlatformImpl for tests. |
35 class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl { | 34 class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl { |
36 public: | 35 public: |
37 TestBlinkWebUnitTestSupport(); | 36 TestBlinkWebUnitTestSupport(); |
38 ~TestBlinkWebUnitTestSupport() override; | 37 ~TestBlinkWebUnitTestSupport() override; |
39 | 38 |
40 blink::WebBlobRegistry* getBlobRegistry() override; | 39 blink::WebBlobRegistry* getBlobRegistry() override; |
41 blink::WebClipboard* clipboard() override; | 40 blink::WebClipboard* clipboard() override; |
42 blink::WebFileUtilities* fileUtilities() override; | 41 blink::WebFileUtilities* fileUtilities() override; |
43 blink::WebIDBFactory* idbFactory() override; | 42 blink::WebIDBFactory* idbFactory() override; |
44 blink::WebMimeRegistry* mimeRegistry() override; | |
45 | 43 |
46 blink::WebURLLoader* createURLLoader() override; | 44 blink::WebURLLoader* createURLLoader() override; |
47 blink::WebString userAgent() override; | 45 blink::WebString userAgent() override; |
48 blink::WebString queryLocalizedString( | 46 blink::WebString queryLocalizedString( |
49 blink::WebLocalizedString::Name name) override; | 47 blink::WebLocalizedString::Name name) override; |
50 blink::WebString queryLocalizedString(blink::WebLocalizedString::Name name, | 48 blink::WebString queryLocalizedString(blink::WebLocalizedString::Name name, |
51 const blink::WebString& value) override; | 49 const blink::WebString& value) override; |
52 blink::WebString queryLocalizedString( | 50 blink::WebString queryLocalizedString( |
53 blink::WebLocalizedString::Name name, | 51 blink::WebLocalizedString::Name name, |
54 const blink::WebString& value1, | 52 const blink::WebString& value1, |
(...skipping 20 matching lines...) Expand all Loading... |
75 const blink::WebSize& size) override; | 73 const blink::WebSize& size) override; |
76 | 74 |
77 void getPluginList(bool refresh, | 75 void getPluginList(bool refresh, |
78 const blink::WebSecurityOrigin& mainFrameOrigin, | 76 const blink::WebSecurityOrigin& mainFrameOrigin, |
79 blink::WebPluginListBuilder* builder) override; | 77 blink::WebPluginListBuilder* builder) override; |
80 | 78 |
81 blink::WebRTCCertificateGenerator* createRTCCertificateGenerator() override; | 79 blink::WebRTCCertificateGenerator* createRTCCertificateGenerator() override; |
82 | 80 |
83 private: | 81 private: |
84 MockWebBlobRegistryImpl blob_registry_; | 82 MockWebBlobRegistryImpl blob_registry_; |
85 SimpleWebMimeRegistryImpl mime_registry_; | |
86 std::unique_ptr<MockWebClipboardImpl> mock_clipboard_; | 83 std::unique_ptr<MockWebClipboardImpl> mock_clipboard_; |
87 WebFileUtilitiesImpl file_utilities_; | 84 WebFileUtilitiesImpl file_utilities_; |
88 base::ScopedTempDir file_system_root_; | 85 base::ScopedTempDir file_system_root_; |
89 std::unique_ptr<blink::WebURLLoaderMockFactory> url_loader_factory_; | 86 std::unique_ptr<blink::WebURLLoaderMockFactory> url_loader_factory_; |
90 cc_blink::WebCompositorSupportImpl compositor_support_; | 87 cc_blink::WebCompositorSupportImpl compositor_support_; |
91 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler_; | 88 std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler_; |
92 std::unique_ptr<blink::WebThread> web_thread_; | 89 std::unique_ptr<blink::WebThread> web_thread_; |
93 std::unique_ptr<cc::TestSharedBitmapManager> shared_bitmap_manager_; | 90 std::unique_ptr<cc::TestSharedBitmapManager> shared_bitmap_manager_; |
94 | 91 |
95 #if defined(OS_WIN) || defined(OS_MACOSX) | 92 #if defined(OS_WIN) || defined(OS_MACOSX) |
96 blink::WebThemeEngine* active_theme_engine_ = nullptr; | 93 blink::WebThemeEngine* active_theme_engine_ = nullptr; |
97 #endif | 94 #endif |
98 DISALLOW_COPY_AND_ASSIGN(TestBlinkWebUnitTestSupport); | 95 DISALLOW_COPY_AND_ASSIGN(TestBlinkWebUnitTestSupport); |
99 }; | 96 }; |
100 | 97 |
101 } // namespace content | 98 } // namespace content |
102 | 99 |
103 #endif // CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_ | 100 #endif // CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_ |
OLD | NEW |