Move DidStartLoading, DidStopLoading, DidChangeLoadProgress IPCs to RFHI.
[chromium-blink-merge.git] / content / test / test_blink_web_unit_test_support.h
blob8bdd355ac1e083550fb4d88e1cd6d32e9d3c9ba9
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_
6 #define CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_
8 #include "base/compiler_specific.h"
9 #include "base/files/scoped_temp_dir.h"
10 #include "cc/blink/web_compositor_support_impl.h"
11 #include "content/child/blink_platform_impl.h"
12 #include "content/child/simple_webmimeregistry_impl.h"
13 #include "content/child/webfileutilities_impl.h"
14 #include "content/test/mock_webblob_registry_impl.h"
15 #include "content/test/mock_webclipboard_impl.h"
16 #include "content/test/weburl_loader_mock_factory.h"
17 #include "third_party/WebKit/public/platform/WebUnitTestSupport.h"
19 namespace base {
20 class StatsTable;
23 namespace blink {
24 class WebLayerTreeView;
25 class WebScheduler;
28 namespace content {
29 class RendererScheduler;
30 class WebSchedulerImpl;
32 // An implementation of blink::WebUnitTestSupport and BlinkPlatformImpl for
33 // tests.
34 class TestBlinkWebUnitTestSupport : public blink::WebUnitTestSupport,
35 public BlinkPlatformImpl {
36 public:
37 TestBlinkWebUnitTestSupport();
38 virtual ~TestBlinkWebUnitTestSupport();
40 virtual blink::WebBlobRegistry* blobRegistry();
41 virtual blink::WebClipboard* clipboard();
42 virtual blink::WebFileUtilities* fileUtilities();
43 virtual blink::WebIDBFactory* idbFactory();
44 virtual blink::WebMimeRegistry* mimeRegistry();
46 virtual blink::WebURLLoader* createURLLoader();
47 virtual blink::WebString userAgent() override;
48 virtual blink::WebData loadResource(const char* name);
49 virtual blink::WebString queryLocalizedString(
50 blink::WebLocalizedString::Name name);
51 virtual blink::WebString queryLocalizedString(
52 blink::WebLocalizedString::Name name,
53 const blink::WebString& value);
54 virtual blink::WebString queryLocalizedString(
55 blink::WebLocalizedString::Name name,
56 const blink::WebString& value1,
57 const blink::WebString& value2);
58 virtual blink::WebString defaultLocale();
60 #if defined(OS_WIN) || defined(OS_MACOSX)
61 void SetThemeEngine(blink::WebThemeEngine* engine);
62 virtual blink::WebThemeEngine* themeEngine();
63 #endif
65 virtual blink::WebCompositorSupport* compositorSupport();
67 virtual blink::WebGestureCurve* createFlingAnimationCurve(
68 blink::WebGestureDevice device_source,
69 const blink::WebFloatPoint& velocity,
70 const blink::WebSize& cumulative_scroll) override;
72 virtual blink::WebUnitTestSupport* unitTestSupport();
74 // WebUnitTestSupport implementation
75 virtual void registerMockedURL(const blink::WebURL& url,
76 const blink::WebURLResponse& response,
77 const blink::WebString& filePath);
78 virtual void registerMockedErrorURL(const blink::WebURL& url,
79 const blink::WebURLResponse& response,
80 const blink::WebURLError& error);
81 virtual void unregisterMockedURL(const blink::WebURL& url);
82 virtual void unregisterAllMockedURLs();
83 virtual void serveAsynchronousMockedRequests();
84 virtual blink::WebString webKitRootDir();
85 virtual blink::WebLayerTreeView* createLayerTreeViewForTesting();
86 virtual blink::WebData readFromFile(const blink::WebString& path);
87 virtual bool getBlobItems(const blink::WebString& uuid,
88 blink::WebVector<blink::WebBlobData::Item*>* items);
89 virtual blink::WebScheduler* scheduler();
90 virtual blink::WebThread* currentThread();
92 private:
93 MockWebBlobRegistryImpl blob_registry_;
94 SimpleWebMimeRegistryImpl mime_registry_;
95 scoped_ptr<MockWebClipboardImpl> mock_clipboard_;
96 WebFileUtilitiesImpl file_utilities_;
97 base::ScopedTempDir file_system_root_;
98 scoped_ptr<WebURLLoaderMockFactory> url_loader_factory_;
99 cc_blink::WebCompositorSupportImpl compositor_support_;
100 scoped_ptr<RendererScheduler> renderer_scheduler_;
101 scoped_ptr<WebSchedulerImpl> web_scheduler_;
102 scoped_ptr<blink::WebThread> web_thread_;
104 #if defined(OS_WIN) || defined(OS_MACOSX)
105 blink::WebThemeEngine* active_theme_engine_;
106 #endif
107 DISALLOW_COPY_AND_ASSIGN(TestBlinkWebUnitTestSupport);
110 } // namespace content
112 #endif // CONTENT_TEST_TEST_BLINK_WEB_UNIT_TEST_SUPPORT_H_