| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_H_ |
| 6 #define CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class DictionaryValue; | 15 class DictionaryValue; |
| 16 class FilePath; | 16 class FilePath; |
| 17 class ListValue; | 17 class ListValue; |
| 18 class TimeDelta; | 18 class TimeDelta; |
| 19 class Value; | 19 class Value; |
| 20 } | 20 } |
| 21 | 21 |
| 22 class DevToolsClient; | 22 class DevToolsClient; |
| 23 struct Geoposition; | 23 struct Geoposition; |
| 24 class JavaScriptDialogManager; | 24 class JavaScriptDialogManager; |
| 25 struct KeyEvent; | 25 struct KeyEvent; |
| 26 struct MouseEvent; | 26 struct MouseEvent; |
| 27 struct NetworkConditions; |
| 27 struct TouchEvent; | 28 struct TouchEvent; |
| 28 class Status; | 29 class Status; |
| 29 | 30 |
| 30 class WebView { | 31 class WebView { |
| 31 public: | 32 public: |
| 32 virtual ~WebView() {} | 33 virtual ~WebView() {} |
| 33 | 34 |
| 34 // Return the id for this WebView. | 35 // Return the id for this WebView. |
| 35 virtual std::string GetId() = 0; | 36 virtual std::string GetId() = 0; |
| 36 | 37 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Returns whether the frame is pending navigation. | 138 // Returns whether the frame is pending navigation. |
| 138 virtual Status IsPendingNavigation( | 139 virtual Status IsPendingNavigation( |
| 139 const std::string& frame_id, bool* is_pending) = 0; | 140 const std::string& frame_id, bool* is_pending) = 0; |
| 140 | 141 |
| 141 // Returns the JavaScriptDialogManager. Never null. | 142 // Returns the JavaScriptDialogManager. Never null. |
| 142 virtual JavaScriptDialogManager* GetJavaScriptDialogManager() = 0; | 143 virtual JavaScriptDialogManager* GetJavaScriptDialogManager() = 0; |
| 143 | 144 |
| 144 // Overrides normal geolocation with a given geoposition. | 145 // Overrides normal geolocation with a given geoposition. |
| 145 virtual Status OverrideGeolocation(const Geoposition& geoposition) = 0; | 146 virtual Status OverrideGeolocation(const Geoposition& geoposition) = 0; |
| 146 | 147 |
| 148 // Overrides normal network conditions with given conditions. |
| 149 virtual Status OverrideNetworkConditions( |
| 150 const NetworkConditions& network_conditions) = 0; |
| 151 |
| 147 // Captures the visible portions of the web view as a base64-encoded PNG. | 152 // Captures the visible portions of the web view as a base64-encoded PNG. |
| 148 virtual Status CaptureScreenshot(std::string* screenshot) = 0; | 153 virtual Status CaptureScreenshot(std::string* screenshot) = 0; |
| 149 | 154 |
| 150 // Set files in a file input element. | 155 // Set files in a file input element. |
| 151 // |element| is the WebElement JSON Object of the input element. | 156 // |element| is the WebElement JSON Object of the input element. |
| 152 virtual Status SetFileInputFiles( | 157 virtual Status SetFileInputFiles( |
| 153 const std::string& frame, | 158 const std::string& frame, |
| 154 const base::DictionaryValue& element, | 159 const base::DictionaryValue& element, |
| 155 const std::vector<base::FilePath>& files) = 0; | 160 const std::vector<base::FilePath>& files) = 0; |
| 156 | 161 |
| 157 // Take a heap snapshot which can build up a graph of Javascript objects. | 162 // Take a heap snapshot which can build up a graph of Javascript objects. |
| 158 // A raw heap snapshot is in JSON format: | 163 // A raw heap snapshot is in JSON format: |
| 159 // 1. A meta data element "snapshot" about how to parse data elements. | 164 // 1. A meta data element "snapshot" about how to parse data elements. |
| 160 // 2. Data elements: "nodes", "edges", "strings". | 165 // 2. Data elements: "nodes", "edges", "strings". |
| 161 virtual Status TakeHeapSnapshot(scoped_ptr<base::Value>* snapshot) = 0; | 166 virtual Status TakeHeapSnapshot(scoped_ptr<base::Value>* snapshot) = 0; |
| 162 | 167 |
| 163 // Start recording Javascript CPU Profile. | 168 // Start recording Javascript CPU Profile. |
| 164 virtual Status StartProfile() = 0; | 169 virtual Status StartProfile() = 0; |
| 165 | 170 |
| 166 // Stop recording Javascript CPU Profile and returns a graph of | 171 // Stop recording Javascript CPU Profile and returns a graph of |
| 167 // CPUProfile objects. The format for the captured profile is defined | 172 // CPUProfile objects. The format for the captured profile is defined |
| 168 // (by DevTools) in protocol.json. | 173 // (by DevTools) in protocol.json. |
| 169 virtual Status EndProfile(scoped_ptr<base::Value>* profile_data) = 0; | 174 virtual Status EndProfile(scoped_ptr<base::Value>* profile_data) = 0; |
| 170 }; | 175 }; |
| 171 | 176 |
| 172 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_H_ | 177 #endif // CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_H_ |
| OLD | NEW |