OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_COMMANDS_WEBELEMENT_COMMANDS_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_WEBELEMENT_COMMANDS_H_ |
6 #define CHROME_TEST_WEBDRIVER_COMMANDS_WEBELEMENT_COMMANDS_H_ | 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_WEBELEMENT_COMMANDS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/test/webdriver/commands/webdriver_command.h" | 11 #include "chrome/test/webdriver/commands/webdriver_command.h" |
12 #include "chrome/test/webdriver/web_element_id.h" | 12 #include "chrome/test/webdriver/web_element_id.h" |
13 | 13 |
14 class DictionaryValue; | 14 class DictionaryValue; |
15 | 15 |
| 16 namespace gfx { |
| 17 class Point; |
| 18 } |
| 19 |
16 namespace webdriver { | 20 namespace webdriver { |
17 | 21 |
| 22 class Error; |
18 class Response; | 23 class Response; |
19 | 24 |
20 // Handles commands that interact with a web element in the WebDriver REST | 25 // Handles commands that interact with a web element in the WebDriver REST |
21 // service. | 26 // service. |
22 class WebElementCommand : public WebDriverCommand { | 27 class WebElementCommand : public WebDriverCommand { |
23 public: | 28 public: |
24 WebElementCommand(const std::vector<std::string>& path_segments, | 29 WebElementCommand(const std::vector<std::string>& path_segments, |
25 const DictionaryValue* const parameters); | 30 const DictionaryValue* const parameters); |
26 virtual ~WebElementCommand(); | 31 virtual ~WebElementCommand(); |
27 | 32 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 ElementValueCommand(const std::vector<std::string>& path_segments, | 247 ElementValueCommand(const std::vector<std::string>& path_segments, |
243 DictionaryValue* parameters); | 248 DictionaryValue* parameters); |
244 virtual ~ElementValueCommand(); | 249 virtual ~ElementValueCommand(); |
245 | 250 |
246 virtual bool DoesGet(); | 251 virtual bool DoesGet(); |
247 virtual bool DoesPost(); | 252 virtual bool DoesPost(); |
248 virtual void ExecuteGet(Response* const response); | 253 virtual void ExecuteGet(Response* const response); |
249 virtual void ExecutePost(Response* const response); | 254 virtual void ExecutePost(Response* const response); |
250 | 255 |
251 private: | 256 private: |
| 257 // Returns whether the element has a given attribute pair. |
| 258 Error* HasAttributeWithLowerCaseValueASCII(const std::string& key, |
| 259 const std::string& value, |
| 260 bool* result) const; |
| 261 Error* DragAndDropFilePaths() const; |
| 262 Error* SendKeys() const; |
| 263 |
252 DISALLOW_COPY_AND_ASSIGN(ElementValueCommand); | 264 DISALLOW_COPY_AND_ASSIGN(ElementValueCommand); |
253 }; | 265 }; |
254 | 266 |
255 // Gets the visible text of the specified web element. | 267 // Gets the visible text of the specified web element. |
256 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/e
lement/:id/text | 268 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/e
lement/:id/text |
257 class ElementTextCommand : public WebElementCommand { | 269 class ElementTextCommand : public WebElementCommand { |
258 public: | 270 public: |
259 ElementTextCommand(const std::vector<std::string>& path_segments, | 271 ElementTextCommand(const std::vector<std::string>& path_segments, |
260 DictionaryValue* parameters); | 272 DictionaryValue* parameters); |
261 virtual ~ElementTextCommand(); | 273 virtual ~ElementTextCommand(); |
262 | 274 |
263 virtual bool DoesGet(); | 275 virtual bool DoesGet(); |
264 virtual void ExecuteGet(Response* const response); | 276 virtual void ExecuteGet(Response* const response); |
265 | 277 |
266 private: | 278 private: |
267 DISALLOW_COPY_AND_ASSIGN(ElementTextCommand); | 279 DISALLOW_COPY_AND_ASSIGN(ElementTextCommand); |
268 }; | 280 }; |
269 | 281 |
270 } // namespace webdriver | 282 } // namespace webdriver |
271 | 283 |
272 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_WEBELEMENT_COMMANDS_H_ | 284 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_WEBELEMENT_COMMANDS_H_ |
OLD | NEW |