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 "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 "cc/blink/web_compositor_support_impl.h" | 10 #include "cc/blink/web_compositor_support_impl.h" |
11 #include "content/child/blink_platform_impl.h" | 11 #include "content/child/blink_platform_impl.h" |
12 #include "content/child/simple_webmimeregistry_impl.h" | 12 #include "content/child/simple_webmimeregistry_impl.h" |
13 #include "content/child/webfileutilities_impl.h" | 13 #include "content/child/webfileutilities_impl.h" |
14 #include "content/test/mock_webblob_registry_impl.h" | 14 #include "content/test/mock_webblob_registry_impl.h" |
15 #include "content/test/mock_webclipboard_impl.h" | 15 #include "content/test/mock_webclipboard_impl.h" |
16 #include "content/test/weburl_loader_mock_factory.h" | 16 #include "content/test/weburl_loader_mock_factory.h" |
17 #include "third_party/WebKit/public/platform/WebUnitTestSupport.h" | 17 #include "third_party/WebKit/public/platform/WebUnitTestSupport.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class StatsTable; | 20 class StatsTable; |
21 } | 21 } |
22 | 22 |
23 namespace blink { | 23 namespace blink { |
24 class WebLayerTreeView; | 24 class WebLayerTreeView; |
25 class WebScheduler; | |
26 } | 25 } |
27 | 26 |
28 namespace content { | 27 namespace content { |
29 class RendererScheduler; | 28 class RendererScheduler; |
30 class WebSchedulerImpl; | |
31 | 29 |
32 // An implementation of blink::WebUnitTestSupport and BlinkPlatformImpl for | 30 // An implementation of blink::WebUnitTestSupport and BlinkPlatformImpl for |
33 // tests. | 31 // tests. |
34 class TestBlinkWebUnitTestSupport : public blink::WebUnitTestSupport, | 32 class TestBlinkWebUnitTestSupport : public blink::WebUnitTestSupport, |
35 public BlinkPlatformImpl { | 33 public BlinkPlatformImpl { |
36 public: | 34 public: |
37 TestBlinkWebUnitTestSupport(); | 35 TestBlinkWebUnitTestSupport(); |
38 virtual ~TestBlinkWebUnitTestSupport(); | 36 virtual ~TestBlinkWebUnitTestSupport(); |
39 | 37 |
40 virtual blink::WebBlobRegistry* blobRegistry(); | 38 virtual blink::WebBlobRegistry* blobRegistry(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 const blink::WebURLResponse& response, | 77 const blink::WebURLResponse& response, |
80 const blink::WebURLError& error); | 78 const blink::WebURLError& error); |
81 virtual void unregisterMockedURL(const blink::WebURL& url); | 79 virtual void unregisterMockedURL(const blink::WebURL& url); |
82 virtual void unregisterAllMockedURLs(); | 80 virtual void unregisterAllMockedURLs(); |
83 virtual void serveAsynchronousMockedRequests(); | 81 virtual void serveAsynchronousMockedRequests(); |
84 virtual blink::WebString webKitRootDir(); | 82 virtual blink::WebString webKitRootDir(); |
85 virtual blink::WebLayerTreeView* createLayerTreeViewForTesting(); | 83 virtual blink::WebLayerTreeView* createLayerTreeViewForTesting(); |
86 virtual blink::WebData readFromFile(const blink::WebString& path); | 84 virtual blink::WebData readFromFile(const blink::WebString& path); |
87 virtual bool getBlobItems(const blink::WebString& uuid, | 85 virtual bool getBlobItems(const blink::WebString& uuid, |
88 blink::WebVector<blink::WebBlobData::Item*>* items); | 86 blink::WebVector<blink::WebBlobData::Item*>* items); |
89 virtual blink::WebScheduler* scheduler(); | |
90 virtual blink::WebThread* currentThread(); | 87 virtual blink::WebThread* currentThread(); |
91 | 88 |
92 private: | 89 private: |
93 MockWebBlobRegistryImpl blob_registry_; | 90 MockWebBlobRegistryImpl blob_registry_; |
94 SimpleWebMimeRegistryImpl mime_registry_; | 91 SimpleWebMimeRegistryImpl mime_registry_; |
95 scoped_ptr<MockWebClipboardImpl> mock_clipboard_; | 92 scoped_ptr<MockWebClipboardImpl> mock_clipboard_; |
96 WebFileUtilitiesImpl file_utilities_; | 93 WebFileUtilitiesImpl file_utilities_; |
97 base::ScopedTempDir file_system_root_; | 94 base::ScopedTempDir file_system_root_; |
98 scoped_ptr<WebURLLoaderMockFactory> url_loader_factory_; | 95 scoped_ptr<WebURLLoaderMockFactory> url_loader_factory_; |
99 cc_blink::WebCompositorSupportImpl compositor_support_; | 96 cc_blink::WebCompositorSupportImpl compositor_support_; |
100 scoped_ptr<RendererScheduler> renderer_scheduler_; | 97 scoped_ptr<RendererScheduler> renderer_scheduler_; |
101 scoped_ptr<WebSchedulerImpl> web_scheduler_; | |
102 scoped_ptr<blink::WebThread> web_thread_; | 98 scoped_ptr<blink::WebThread> web_thread_; |
103 | 99 |
104 #if defined(OS_WIN) || defined(OS_MACOSX) | 100 #if defined(OS_WIN) || defined(OS_MACOSX) |
105 blink::WebThemeEngine* active_theme_engine_; | 101 blink::WebThemeEngine* active_theme_engine_; |
106 #endif | 102 #endif |
107 DISALLOW_COPY_AND_ASSIGN(TestBlinkWebUnitTestSupport); | 103 DISALLOW_COPY_AND_ASSIGN(TestBlinkWebUnitTestSupport); |
108 }; | 104 }; |
109 | 105 |
110 } // namespace content | 106 } // namespace content |
111 | 107 |
112 #endif // CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_ | 108 #endif // CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_ |
OLD | NEW |