1// Copyright 2014 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_TEST_INTERFACES_H_ 6#define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_INTERFACES_H_ 7 8#include <vector> 9 10#include "base/basictypes.h" 11#include "base/memory/scoped_ptr.h" 12#include "base/memory/weak_ptr.h" 13#include "third_party/WebKit/public/platform/WebNonCopyable.h" 14 15#if defined(OS_MACOSX) 16#include "content/shell/renderer/test_runner/mock_web_theme_engine_mac.h" 17#else 18#include "content/shell/renderer/test_runner/mock_web_theme_engine.h" 19#endif 20 21namespace blink { 22class WebFrame; 23class WebThemeEngine; 24class WebURL; 25class WebView; 26} 27 28namespace content { 29 30class AccessibilityController; 31class EventSender; 32class GamepadController; 33class TestRunner; 34class TextInputController; 35class WebTestDelegate; 36class WebTestProxyBase; 37 38class TestInterfaces { 39 public: 40 TestInterfaces(); 41 ~TestInterfaces(); 42 43 void SetWebView(blink::WebView* web_view, WebTestProxyBase* proxy); 44 void SetDelegate(WebTestDelegate* delegate); 45 void BindTo(blink::WebFrame* frame); 46 void ResetTestHelperControllers(); 47 void ResetAll(); 48 void SetTestIsRunning(bool running); 49 void ConfigureForTestWithURL(const blink::WebURL& test_url, 50 bool generate_pixels); 51 52 void WindowOpened(WebTestProxyBase* proxy); 53 void WindowClosed(WebTestProxyBase* proxy); 54 55 AccessibilityController* GetAccessibilityController(); 56 EventSender* GetEventSender(); 57 TestRunner* GetTestRunner(); 58 WebTestDelegate* GetDelegate(); 59 WebTestProxyBase* GetProxy(); 60 const std::vector<WebTestProxyBase*>& GetWindowList(); 61 blink::WebThemeEngine* GetThemeEngine(); 62 63 private: 64 scoped_ptr<AccessibilityController> accessibility_controller_; 65 scoped_ptr<EventSender> event_sender_; 66 base::WeakPtr<GamepadController> gamepad_controller_; 67 scoped_ptr<TextInputController> text_input_controller_; 68 scoped_ptr<TestRunner> test_runner_; 69 WebTestDelegate* delegate_; 70 WebTestProxyBase* proxy_; 71 72 std::vector<WebTestProxyBase*> window_list_; 73#if defined(OS_MACOSX) 74 scoped_ptr<MockWebThemeEngineMac> theme_engine_; 75#else 76 scoped_ptr<MockWebThemeEngine> theme_engine_; 77#endif 78 79 DISALLOW_COPY_AND_ASSIGN(TestInterfaces); 80}; 81 82} // namespace content 83 84#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_INTERFACES_H_ 85