| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WEBDRIVER_SESSION_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_SESSION_H_ |
| 6 #define CHROME_TEST_WEBDRIVER_SESSION_H_ | 6 #define CHROME_TEST_WEBDRIVER_SESSION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // Send the given keys to the given element dictionary. This function takes | 71 // Send the given keys to the given element dictionary. This function takes |
| 72 // ownership of |element|. | 72 // ownership of |element|. |
| 73 ErrorCode SendKeys(DictionaryValue* element, const string16& keys); | 73 ErrorCode SendKeys(DictionaryValue* element, const string16& keys); |
| 74 | 74 |
| 75 // Click events with the mouse should use the values found in: | 75 // Click events with the mouse should use the values found in: |
| 76 // views/events/event.h. In the Webdriver JSON spec the MouseMove | 76 // views/events/event.h. In the Webdriver JSON spec the MouseMove |
| 77 // function directly maps to the hover command. | 77 // function directly maps to the hover command. |
| 78 void MouseClick(const gfx::Point& click, int flags); | 78 void MouseClick(const gfx::Point& click, int flags); |
| 79 bool MouseMove(const gfx::Point& location); | 79 bool MouseMove(const gfx::Point& location); |
| 80 bool MouseDrag(const gfx::Point& start, const gfx::Point& end); | 80 bool MouseDrag(const gfx::Point& start, const gfx::Point& end); |
| 81 | |
| 82 bool NavigateToURL(const std::string& url); | 81 bool NavigateToURL(const std::string& url); |
| 83 bool GoForward(); | 82 bool GoForward(); |
| 84 bool GoBack(); | 83 bool GoBack(); |
| 85 bool Reload(); | 84 bool Reload(); |
| 86 bool GetURL(GURL* url); | 85 bool GetURL(GURL* url); |
| 87 bool GetURL(std::string* url); | 86 bool GetURL(std::string* url); |
| 88 bool GetTabTitle(std::string* tab_title); | 87 bool GetTabTitle(std::string* tab_title); |
| 89 bool GetCookies(const GURL& url, std::string* cookies); | 88 bool GetCookies(const GURL& url, std::string* cookies); |
| 90 bool GetCookieByName(const GURL& url, const std::string& cookie_name, | 89 bool GetCookieByName(const GURL& url, const std::string& cookie_name, |
| 91 std::string* cookie); | 90 std::string* cookie); |
| 92 bool DeleteCookie(const GURL& url, const std::string& cookie_name); | 91 bool DeleteCookie(const GURL& url, const std::string& cookie_name); |
| 93 bool SetCookie(const GURL& url, const std::string& cookie); | 92 bool SetCookie(const GURL& url, const std::string& cookie); |
| 93 bool CaptureEntirePageAsPNG(const FilePath& path); |
| 94 bool ScreenshotAsBase64(std::string* screenshot); |
| 94 | 95 |
| 95 // Gets all the currently existing window IDs. Returns true on success. | 96 // Gets all the currently existing window IDs. Returns true on success. |
| 96 bool GetWindowIds(std::vector<int>* window_ids); | 97 bool GetWindowIds(std::vector<int>* window_ids); |
| 97 | 98 |
| 98 // Switches the window used by default. |name| is either an ID returned by | 99 // Switches the window used by default. |name| is either an ID returned by |
| 99 // |GetWindowIds| or the name attribute of a DOM window. | 100 // |GetWindowIds| or the name attribute of a DOM window. |
| 100 ErrorCode SwitchToWindow(const std::string& name); | 101 ErrorCode SwitchToWindow(const std::string& name); |
| 101 | 102 |
| 102 // Switches the frame used by default. |name_or_id| is either the name or id | 103 // Switches the frame used by default. |name_or_id| is either the name or id |
| 103 // of a frame element. | 104 // of a frame element. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 int current_window_id_; | 168 int current_window_id_; |
| 168 | 169 |
| 169 DISALLOW_COPY_AND_ASSIGN(Session); | 170 DISALLOW_COPY_AND_ASSIGN(Session); |
| 170 }; | 171 }; |
| 171 | 172 |
| 172 } // namespace webdriver | 173 } // namespace webdriver |
| 173 | 174 |
| 174 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); | 175 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); |
| 175 | 176 |
| 176 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ | 177 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ |
| OLD | NEW |