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_WEBKIT_PLATFORM_SUPPORT_H_ | 5 #ifndef CONTENT_TEST_TEST_WEBKIT_PLATFORM_SUPPORT_H_ |
6 #define CONTENT_TEST_TEST_WEBKIT_PLATFORM_SUPPORT_H_ | 6 #define CONTENT_TEST_TEST_WEBKIT_PLATFORM_SUPPORT_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "content/child/blink_platform_impl.h" | 10 #include "content/child/blink_platform_impl.h" |
11 #include "content/child/simple_webmimeregistry_impl.h" | 11 #include "content/child/simple_webmimeregistry_impl.h" |
12 #include "content/child/webfileutilities_impl.h" | 12 #include "content/child/webfileutilities_impl.h" |
13 #include "content/renderer/compositor_bindings/web_compositor_support_impl.h" | 13 #include "content/renderer/compositor_bindings/web_compositor_support_impl.h" |
| 14 #include "content/test/mock_webblob_registry_impl.h" |
14 #include "content/test/mock_webclipboard_impl.h" | 15 #include "content/test/mock_webclipboard_impl.h" |
15 #include "content/test/weburl_loader_mock_factory.h" | 16 #include "content/test/weburl_loader_mock_factory.h" |
16 #include "third_party/WebKit/public/platform/WebUnitTestSupport.h" | 17 #include "third_party/WebKit/public/platform/WebUnitTestSupport.h" |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class StatsTable; | 20 class StatsTable; |
20 } | 21 } |
21 | 22 |
22 namespace blink { | 23 namespace blink { |
23 class WebLayerTreeView; | 24 class WebLayerTreeView; |
24 } | 25 } |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 | 28 |
28 // An implementation of WebKitPlatformSupport for tests. | 29 // An implementation of WebKitPlatformSupport for tests. |
29 class TestWebKitPlatformSupport | 30 class TestWebKitPlatformSupport |
30 : public blink::WebUnitTestSupport, | 31 : public blink::WebUnitTestSupport, |
31 public BlinkPlatformImpl { | 32 public BlinkPlatformImpl { |
32 public: | 33 public: |
33 TestWebKitPlatformSupport(); | 34 TestWebKitPlatformSupport(); |
34 virtual ~TestWebKitPlatformSupport(); | 35 virtual ~TestWebKitPlatformSupport(); |
35 | 36 |
36 virtual blink::WebMimeRegistry* mimeRegistry(); | 37 virtual blink::WebBlobRegistry* blobRegistry(); |
37 virtual blink::WebClipboard* clipboard(); | 38 virtual blink::WebClipboard* clipboard(); |
38 virtual blink::WebFileUtilities* fileUtilities(); | 39 virtual blink::WebFileUtilities* fileUtilities(); |
39 virtual blink::WebIDBFactory* idbFactory(); | 40 virtual blink::WebIDBFactory* idbFactory(); |
| 41 virtual blink::WebMimeRegistry* mimeRegistry(); |
40 | 42 |
41 virtual blink::WebURLLoader* createURLLoader(); | 43 virtual blink::WebURLLoader* createURLLoader(); |
42 virtual blink::WebString userAgent() OVERRIDE; | 44 virtual blink::WebString userAgent() OVERRIDE; |
43 virtual blink::WebData loadResource(const char* name); | 45 virtual blink::WebData loadResource(const char* name); |
44 virtual blink::WebString queryLocalizedString( | 46 virtual blink::WebString queryLocalizedString( |
45 blink::WebLocalizedString::Name name); | 47 blink::WebLocalizedString::Name name); |
46 virtual blink::WebString queryLocalizedString( | 48 virtual blink::WebString queryLocalizedString( |
47 blink::WebLocalizedString::Name name, | 49 blink::WebLocalizedString::Name name, |
48 const blink::WebString& value); | 50 const blink::WebString& value); |
49 virtual blink::WebString queryLocalizedString( | 51 virtual blink::WebString queryLocalizedString( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 const blink::WebURLResponse& response, | 84 const blink::WebURLResponse& response, |
83 const blink::WebURLError& error); | 85 const blink::WebURLError& error); |
84 virtual void unregisterMockedURL(const blink::WebURL& url); | 86 virtual void unregisterMockedURL(const blink::WebURL& url); |
85 virtual void unregisterAllMockedURLs(); | 87 virtual void unregisterAllMockedURLs(); |
86 virtual void serveAsynchronousMockedRequests(); | 88 virtual void serveAsynchronousMockedRequests(); |
87 virtual blink::WebString webKitRootDir(); | 89 virtual blink::WebString webKitRootDir(); |
88 virtual blink::WebLayerTreeView* createLayerTreeViewForTesting(); | 90 virtual blink::WebLayerTreeView* createLayerTreeViewForTesting(); |
89 virtual blink::WebData readFromFile(const blink::WebString& path); | 91 virtual blink::WebData readFromFile(const blink::WebString& path); |
90 | 92 |
91 private: | 93 private: |
| 94 MockWebBlobRegistryImpl blob_registry_; |
92 SimpleWebMimeRegistryImpl mime_registry_; | 95 SimpleWebMimeRegistryImpl mime_registry_; |
93 scoped_ptr<MockWebClipboardImpl> mock_clipboard_; | 96 scoped_ptr<MockWebClipboardImpl> mock_clipboard_; |
94 WebFileUtilitiesImpl file_utilities_; | 97 WebFileUtilitiesImpl file_utilities_; |
95 base::ScopedTempDir file_system_root_; | 98 base::ScopedTempDir file_system_root_; |
96 scoped_ptr<WebURLLoaderMockFactory> url_loader_factory_; | 99 scoped_ptr<WebURLLoaderMockFactory> url_loader_factory_; |
97 WebCompositorSupportImpl compositor_support_; | 100 WebCompositorSupportImpl compositor_support_; |
98 scoped_ptr<base::StatsTable> stats_table_; | 101 scoped_ptr<base::StatsTable> stats_table_; |
99 | 102 |
100 #if defined(OS_WIN) || defined(OS_MACOSX) | 103 #if defined(OS_WIN) || defined(OS_MACOSX) |
101 blink::WebThemeEngine* active_theme_engine_; | 104 blink::WebThemeEngine* active_theme_engine_; |
102 #endif | 105 #endif |
103 DISALLOW_COPY_AND_ASSIGN(TestWebKitPlatformSupport); | 106 DISALLOW_COPY_AND_ASSIGN(TestWebKitPlatformSupport); |
104 }; | 107 }; |
105 | 108 |
106 } // namespace content | 109 } // namespace content |
107 | 110 |
108 #endif // CONTENT_TEST_TEST_WEBKIT_PLATFORM_SUPPORT_H_ | 111 #endif // CONTENT_TEST_TEST_WEBKIT_PLATFORM_SUPPORT_H_ |
OLD | NEW |