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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/values.h" | |
13 #include "chrome/test/webdriver/automation.h" | 12 #include "chrome/test/webdriver/automation.h" |
14 #include "chrome/test/webdriver/error_codes.h" | 13 #include "chrome/test/webdriver/error_codes.h" |
15 | 14 |
| 15 class GURL; |
16 class ListValue; | 16 class ListValue; |
17 class Value; | 17 class Value; |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class WaitableEvent; | 20 class WaitableEvent; |
21 } | 21 } |
22 | 22 |
23 namespace webdriver { | 23 namespace webdriver { |
24 | 24 |
25 // Every connection made by WebDriver maps to a session object. | 25 // Every connection made by WebDriver maps to a session object. |
(...skipping 23 matching lines...) Expand all Loading... |
49 Value** value); | 49 Value** value); |
50 | 50 |
51 // Send the given keys to the given element dictionary. This function takes | 51 // Send the given keys to the given element dictionary. This function takes |
52 // ownership of |element|. | 52 // ownership of |element|. |
53 ErrorCode SendKeys(DictionaryValue* element, const string16& keys); | 53 ErrorCode SendKeys(DictionaryValue* element, const string16& keys); |
54 | 54 |
55 bool NavigateToURL(const std::string& url); | 55 bool NavigateToURL(const std::string& url); |
56 bool GoForward(); | 56 bool GoForward(); |
57 bool GoBack(); | 57 bool GoBack(); |
58 bool Reload(); | 58 bool Reload(); |
| 59 bool GetURL(GURL* url); |
59 bool GetURL(std::string* url); | 60 bool GetURL(std::string* url); |
60 bool GetTabTitle(std::string* tab_title); | 61 bool GetTabTitle(std::string* tab_title); |
| 62 bool GetCookies(const GURL& url, std::string* cookies); |
| 63 bool GetCookieByName(const GURL& url, const std::string& cookie_name, |
| 64 std::string* cookie); |
| 65 bool DeleteCookie(const GURL& url, const std::string& cookie_name); |
| 66 bool SetCookie(const GURL& url, const std::string& cookie); |
61 | 67 |
62 inline const std::string& id() const { return id_; } | 68 inline const std::string& id() const { return id_; } |
63 | 69 |
64 inline int implicit_wait() { return implicit_wait_; } | 70 inline int implicit_wait() { return implicit_wait_; } |
65 inline void set_implicit_wait(const int& timeout) { | 71 inline void set_implicit_wait(const int& timeout) { |
66 implicit_wait_ = timeout > 0 ? timeout : 0; | 72 implicit_wait_ = timeout > 0 ? timeout : 0; |
67 } | 73 } |
68 | 74 |
69 enum Speed { kSlow, kMedium, kFast, kUnknown }; | 75 enum Speed { kSlow, kMedium, kFast, kUnknown }; |
70 inline Speed speed() { return speed_; } | 76 inline Speed speed() { return speed_; } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 std::string current_frame_xpath_; | 114 std::string current_frame_xpath_; |
109 | 115 |
110 DISALLOW_COPY_AND_ASSIGN(Session); | 116 DISALLOW_COPY_AND_ASSIGN(Session); |
111 }; | 117 }; |
112 | 118 |
113 } // namespace webdriver | 119 } // namespace webdriver |
114 | 120 |
115 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); | 121 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); |
116 | 122 |
117 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ | 123 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ |
OLD | NEW |