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 webdriver { | 16 namespace webdriver { |
17 | 17 |
18 class Error; | |
18 class Response; | 19 class Response; |
19 | 20 |
20 // Handles commands that interact with a web element in the WebDriver REST | 21 // Handles commands that interact with a web element in the WebDriver REST |
21 // service. | 22 // service. |
22 class WebElementCommand : public WebDriverCommand { | 23 class WebElementCommand : public WebDriverCommand { |
23 public: | 24 public: |
24 WebElementCommand(const std::vector<std::string>& path_segments, | 25 WebElementCommand(const std::vector<std::string>& path_segments, |
25 const DictionaryValue* const parameters); | 26 const DictionaryValue* const parameters); |
26 virtual ~WebElementCommand(); | 27 virtual ~WebElementCommand(); |
27 | 28 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
242 ElementValueCommand(const std::vector<std::string>& path_segments, | 243 ElementValueCommand(const std::vector<std::string>& path_segments, |
243 DictionaryValue* parameters); | 244 DictionaryValue* parameters); |
244 virtual ~ElementValueCommand(); | 245 virtual ~ElementValueCommand(); |
245 | 246 |
246 virtual bool DoesGet(); | 247 virtual bool DoesGet(); |
247 virtual bool DoesPost(); | 248 virtual bool DoesPost(); |
248 virtual void ExecuteGet(Response* const response); | 249 virtual void ExecuteGet(Response* const response); |
249 virtual void ExecutePost(Response* const response); | 250 virtual void ExecutePost(Response* const response); |
250 | 251 |
251 private: | 252 private: |
253 void SetFilePathsToFileUploadControl(Response* const response) const; | |
kkania
2011/05/23 18:43:49
how about return Error* for these instead of passi
nodchip
2011/05/26 01:14:53
Done.
| |
254 void SendKeys(Response* const response) const; | |
255 Error* GetElementAttribute(const std::string& key, std::string* value) const; | |
256 | |
252 DISALLOW_COPY_AND_ASSIGN(ElementValueCommand); | 257 DISALLOW_COPY_AND_ASSIGN(ElementValueCommand); |
253 }; | 258 }; |
254 | 259 |
255 // Gets the visible text of the specified web element. | 260 // Gets the visible text of the specified web element. |
256 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/e lement/:id/text | 261 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/e lement/:id/text |
257 class ElementTextCommand : public WebElementCommand { | 262 class ElementTextCommand : public WebElementCommand { |
258 public: | 263 public: |
259 ElementTextCommand(const std::vector<std::string>& path_segments, | 264 ElementTextCommand(const std::vector<std::string>& path_segments, |
260 DictionaryValue* parameters); | 265 DictionaryValue* parameters); |
261 virtual ~ElementTextCommand(); | 266 virtual ~ElementTextCommand(); |
262 | 267 |
263 virtual bool DoesGet(); | 268 virtual bool DoesGet(); |
264 virtual void ExecuteGet(Response* const response); | 269 virtual void ExecuteGet(Response* const response); |
265 | 270 |
266 private: | 271 private: |
267 DISALLOW_COPY_AND_ASSIGN(ElementTextCommand); | 272 DISALLOW_COPY_AND_ASSIGN(ElementTextCommand); |
268 }; | 273 }; |
269 | 274 |
270 } // namespace webdriver | 275 } // namespace webdriver |
271 | 276 |
272 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_WEBELEMENT_COMMANDS_H_ | 277 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_WEBELEMENT_COMMANDS_H_ |
OLD | NEW |