| OLD | NEW |
| 1 // Copyright (c) 2010 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_COMMANDS_FIND_ELEMENT_COMMANDS_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_FIND_ELEMENT_COMMANDS_H_ |
| 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_FIND_ELEMENT_COMMANDS_H_ | 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_FIND_ELEMENT_COMMANDS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "chrome/test/webdriver/commands/command.h" | 11 #include "chrome/test/webdriver/commands/command.h" |
| 12 #include "chrome/test/webdriver/commands/webdriver_command.h" | 12 #include "chrome/test/webdriver/commands/webdriver_command.h" |
| 13 | 13 |
| 14 namespace webdriver { | 14 namespace webdriver { |
| 15 | 15 |
| 16 // Base class for searching a page, this class can find either a single | 16 // Base class for searching a page, this class can find either a single |
| 17 // webelement or return multiple matches. | 17 // webelement or return multiple matches. |
| 18 class FindElementCommand : public WebDriverCommand { | 18 class FindElementCommand : public WebDriverCommand { |
| 19 public: | 19 public: |
| 20 FindElementCommand(const std::vector<std::string>& path_segments, | 20 FindElementCommand(const std::vector<std::string>& path_segments, |
| 21 const DictionaryValue* const parameters, | 21 const DictionaryValue* const parameters, |
| 22 const bool find_one_element) | 22 const bool find_one_element); |
| 23 : WebDriverCommand(path_segments, parameters), | 23 virtual ~FindElementCommand(); |
| 24 find_one_element_(find_one_element) {} | |
| 25 virtual ~FindElementCommand() {} | |
| 26 | 24 |
| 27 virtual bool Init(Response* const response); | 25 virtual bool Init(Response* const response); |
| 28 | 26 |
| 29 virtual bool DoesPost() { return true; } | 27 virtual bool DoesPost(); |
| 30 virtual void ExecutePost(Response* const response); | 28 virtual void ExecutePost(Response* const response); |
| 31 | 29 |
| 32 private: | 30 private: |
| 33 virtual bool RequiresValidTab() { return false; } | 31 virtual bool RequiresValidTab(); |
| 34 const bool find_one_element_; | 32 const bool find_one_element_; |
| 35 std::string root_element_id_; | 33 std::string root_element_id_; |
| 36 std::string use_; | 34 std::string use_; |
| 37 std::string value_; | 35 std::string value_; |
| 38 | 36 |
| 39 DISALLOW_COPY_AND_ASSIGN(FindElementCommand); | 37 DISALLOW_COPY_AND_ASSIGN(FindElementCommand); |
| 40 }; | 38 }; |
| 41 | 39 |
| 42 // Search for an element on the page, starting from the document root. | 40 // Search for an element on the page, starting from the document root. |
| 43 // The located element will be returned as a WebElement JSON object. See: | 41 // The located element will be returned as a WebElement JSON object. See: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 65 virtual ~FindManyElementsCommand() {} | 63 virtual ~FindManyElementsCommand() {} |
| 66 | 64 |
| 67 private: | 65 private: |
| 68 DISALLOW_COPY_AND_ASSIGN(FindManyElementsCommand); | 66 DISALLOW_COPY_AND_ASSIGN(FindManyElementsCommand); |
| 69 }; | 67 }; |
| 70 | 68 |
| 71 } // namespace webdriver | 69 } // namespace webdriver |
| 72 | 70 |
| 73 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_FIND_ELEMENT_COMMANDS_H_ | 71 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_FIND_ELEMENT_COMMANDS_H_ |
| 74 | 72 |
| OLD | NEW |