Index: chrome/test/chromedriver/chrome.h |
diff --git a/chrome/test/chromedriver/chrome.h b/chrome/test/chromedriver/chrome.h |
index c7a6e5c51550573aa2e7af9c817d1d62a954156e..87f98bf9390afccf6ed9284ffbbdb1d974d0445a 100644 |
--- a/chrome/test/chromedriver/chrome.h |
+++ b/chrome/test/chromedriver/chrome.h |
@@ -20,12 +20,36 @@ class Chrome { |
public: |
virtual ~Chrome() {} |
+ // Load a given URL in the main frame. |
virtual Status Load(const std::string& url) = 0; |
- virtual Status EvaluateScript(const std::string& expression, |
+ |
+ // Evaluates a JavaScript expression in a specified frame and returns |
+ // the result. |frame| is a frame ID or an empty string for the main frame. |
+ // If the expression evaluates to a element, it will be bound to a unique ID |
+ // (per frame) and the ID will be returned. |
+ virtual Status EvaluateScript(const std::string& frame, |
+ const std::string& expression, |
scoped_ptr<base::Value>* result) = 0; |
- virtual Status CallFunction(const std::string& function, |
+ |
+ // Calls a JavaScript function in a specified frame with the given args and |
+ // returns the result. |frame| is a frame ID or an empty string for the main |
+ // frame. |args| may contain IDs that refer to previously returned elements. |
+ // These will be translated back to their referred objects before invoking the |
+ // function. |
+ virtual Status CallFunction(const std::string& frame, |
+ const std::string& function, |
const base::ListValue& args, |
scoped_ptr<base::Value>* result) = 0; |
+ |
+ // Gets the frame ID for a frame element returned by invoking the given |
+ // JavaScript function. |frame| is a frame ID or an empty string for the main |
+ // frame. |
+ virtual Status GetFrameByFunction(const std::string& frame, |
+ const std::string& function, |
+ const base::ListValue& args, |
+ std::string* out_frame) = 0; |
+ |
+ // Quits Chrome. |
virtual Status Quit() = 0; |
}; |