Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / content / shell / renderer / test_runner / TestInterfaces.h
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.
4
5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TESTINTERFACES_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TESTINTERFACES_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "third_party/WebKit/public/platform/WebNonCopyable.h"
13
14 #if defined(USE_DEFAULT_RENDER_THEME)
15 #include "content/shell/renderer/test_runner/WebTestThemeEngineMock.h"
16 #elif defined(WIN32)
17 #include "content/shell/renderer/test_runner/WebTestThemeEngineWin.h"
18 #elif defined(__APPLE__)
19 #include "content/shell/renderer/test_runner/WebTestThemeEngineMac.h"
20 #endif
21
22 namespace blink {
23 class WebFrame;
24 class WebThemeEngine;
25 class WebURL;
26 class WebView;
27 }
28
29 namespace WebTestRunner {
30
31 class AccessibilityController;
32 class EventSender;
33 class GamepadController;
34 class TestRunner;
35 class TextInputController;
36 class WebTestDelegate;
37 class WebTestProxyBase;
38
39 class TestInterfaces {
40 public:
41     TestInterfaces();
42     ~TestInterfaces();
43
44     void setWebView(blink::WebView*, WebTestProxyBase*);
45     void setDelegate(WebTestDelegate*);
46     void bindTo(blink::WebFrame*);
47     void resetTestHelperControllers();
48     void resetAll();
49     void setTestIsRunning(bool);
50     void configureForTestWithURL(const blink::WebURL&, bool generatePixels);
51
52     void windowOpened(WebTestProxyBase*);
53     void windowClosed(WebTestProxyBase*);
54
55     AccessibilityController* accessibilityController();
56     EventSender* eventSender();
57     TestRunner* testRunner();
58     WebTestDelegate* delegate();
59     WebTestProxyBase* proxy();
60     const std::vector<WebTestProxyBase*>& windowList();
61     blink::WebThemeEngine* themeEngine();
62
63 private:
64     scoped_ptr<AccessibilityController> m_accessibilityController;
65     scoped_ptr<EventSender> m_eventSender;
66     scoped_ptr<GamepadController> m_gamepadController;
67     scoped_ptr<TextInputController> m_textInputController;
68     scoped_ptr<TestRunner> m_testRunner;
69     WebTestDelegate* m_delegate;
70     WebTestProxyBase* m_proxy;
71
72     std::vector<WebTestProxyBase*> m_windowList;
73 #if defined(USE_DEFAULT_RENDER_THEME)
74     scoped_ptr<WebTestThemeEngineMock> m_themeEngine;
75 #elif defined(WIN32)
76     scoped_ptr<WebTestThemeEngineWin> m_themeEngine;
77 #elif defined(__APPLE__)
78     scoped_ptr<WebTestThemeEngineMac> m_themeEngine;
79 #endif
80
81     DISALLOW_COPY_AND_ASSIGN(TestInterfaces);
82 };
83
84 }
85
86 #endif  // CONTENT_SHELL_RENDERER_TEST_RUNNER_TESTINTERFACES_H_