1 // Copyright (c) 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 CHROME_TEST_CHROMEDRIVER_CHROME_STUB_WEB_VIEW_H_
6 #define CHROME_TEST_CHROMEDRIVER_CHROME_STUB_WEB_VIEW_H_
11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/test/chromedriver/chrome/web_view.h"
15 class StubWebView : public WebView {
17 explicit StubWebView(const std::string& id);
18 ~StubWebView() override;
20 // Overridden from WebView:
21 std::string GetId() override;
22 bool WasCrashed() override;
23 Status ConnectIfNecessary() override;
24 Status HandleReceivedEvents() override;
25 Status Load(const std::string& url) override;
26 Status Reload() override;
27 Status EvaluateScript(const std::string& frame,
28 const std::string& function,
29 scoped_ptr<base::Value>* result) override;
30 Status CallFunction(const std::string& frame,
31 const std::string& function,
32 const base::ListValue& args,
33 scoped_ptr<base::Value>* result) override;
34 Status CallAsyncFunction(const std::string& frame,
35 const std::string& function,
36 const base::ListValue& args,
37 const base::TimeDelta& timeout,
38 scoped_ptr<base::Value>* result) override;
39 Status CallUserAsyncFunction(const std::string& frame,
40 const std::string& function,
41 const base::ListValue& args,
42 const base::TimeDelta& timeout,
43 scoped_ptr<base::Value>* result) override;
44 Status GetFrameByFunction(const std::string& frame,
45 const std::string& function,
46 const base::ListValue& args,
47 std::string* out_frame) override;
48 Status DispatchMouseEvents(const std::list<MouseEvent>& events,
49 const std::string& frame) override;
50 Status DispatchTouchEvent(const TouchEvent& event) override;
51 Status DispatchTouchEvents(const std::list<TouchEvent>& events) override;
52 Status DispatchKeyEvents(const std::list<KeyEvent>& events) override;
53 Status GetCookies(scoped_ptr<base::ListValue>* cookies) override;
54 Status DeleteCookie(const std::string& name, const std::string& url) override;
55 Status WaitForPendingNavigations(const std::string& frame_id,
56 const base::TimeDelta& timeout,
57 bool stop_load_on_timeout) override;
58 Status IsPendingNavigation(const std::string& frame_id,
59 bool* is_pending) override;
60 JavaScriptDialogManager* GetJavaScriptDialogManager() override;
61 Status OverrideGeolocation(const Geoposition& geoposition) override;
62 Status CaptureScreenshot(std::string* screenshot) override;
63 Status SetFileInputFiles(const std::string& frame,
64 const base::DictionaryValue& element,
65 const std::vector<base::FilePath>& files) override;
66 Status TakeHeapSnapshot(scoped_ptr<base::Value>* snapshot) override;
67 Status StartProfile() override;
68 Status EndProfile(scoped_ptr<base::Value>* profile_data) override;
74 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_STUB_WEB_VIEW_H_