summaryrefslogtreecommitdiffstats
path: root/content/shell/renderer/test_runner/TestInterfaces.h
blob: 69e490c81d513700183c3f951971046cc30906bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TESTINTERFACES_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_TESTINTERFACES_H_

#include <vector>

#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/WebKit/public/platform/WebNonCopyable.h"

#if defined(__APPLE__)
#include "content/shell/renderer/test_runner/WebTestThemeEngineMac.h"
#else
#include "content/shell/renderer/test_runner/WebTestThemeEngineMock.h"
#endif

namespace blink {
class WebFrame;
class WebThemeEngine;
class WebURL;
class WebView;
}

namespace content {
class GamepadController;
class TextInputController;
}

namespace WebTestRunner {

class AccessibilityController;
class EventSender;
class TestRunner;
class WebTestDelegate;
class WebTestProxyBase;

class TestInterfaces {
public:
    TestInterfaces();
    ~TestInterfaces();

    void setWebView(blink::WebView*, WebTestProxyBase*);
    void setDelegate(WebTestDelegate*);
    void bindTo(blink::WebFrame*);
    void resetTestHelperControllers();
    void resetAll();
    void setTestIsRunning(bool);
    void configureForTestWithURL(const blink::WebURL&, bool generatePixels);

    void windowOpened(WebTestProxyBase*);
    void windowClosed(WebTestProxyBase*);

    AccessibilityController* accessibilityController();
    EventSender* eventSender();
    TestRunner* testRunner();
    WebTestDelegate* delegate();
    WebTestProxyBase* proxy();
    const std::vector<WebTestProxyBase*>& windowList();
    blink::WebThemeEngine* themeEngine();

private:
    scoped_ptr<AccessibilityController> m_accessibilityController;
    scoped_ptr<EventSender> m_eventSender;
    scoped_ptr<content::GamepadController> m_gamepadController;
    scoped_ptr<content::TextInputController> m_textInputController;
    scoped_ptr<TestRunner> m_testRunner;
    WebTestDelegate* m_delegate;
    WebTestProxyBase* m_proxy;

    std::vector<WebTestProxyBase*> m_windowList;
#if defined(__APPLE__)
    scoped_ptr<WebTestThemeEngineMac> m_themeEngine;
#else
    scoped_ptr<WebTestThemeEngineMock> m_themeEngine;
#endif

    DISALLOW_COPY_AND_ASSIGN(TestInterfaces);
};

}

#endif  // CONTENT_SHELL_RENDERER_TEST_RUNNER_TESTINTERFACES_H_