| 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_COMMANDS_TARGET_LOCATOR_COMMANDS_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_TARGET_LOCATOR_COMMANDS_H_ |
| 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_TARGET_LOCATOR_COMMANDS_H_ | 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_TARGET_LOCATOR_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 | 12 |
| 13 namespace base { |
| 13 class DictionaryValue; | 14 class DictionaryValue; |
| 15 } |
| 14 | 16 |
| 15 namespace webdriver { | 17 namespace webdriver { |
| 16 | 18 |
| 17 class Response; | 19 class Response; |
| 18 class WebElementId; | 20 class WebElementId; |
| 19 | 21 |
| 20 // Gets the current window handle. | 22 // Gets the current window handle. |
| 21 // REST URL: /session/:sessionId/window_handle | 23 // REST URL: /session/:sessionId/window_handle |
| 22 class WindowHandleCommand : public WebDriverCommand { | 24 class WindowHandleCommand : public WebDriverCommand { |
| 23 public: | 25 public: |
| 24 WindowHandleCommand(const std::vector<std::string>& path_segments, | 26 WindowHandleCommand(const std::vector<std::string>& path_segments, |
| 25 DictionaryValue* parameters); | 27 base::DictionaryValue* parameters); |
| 26 virtual ~WindowHandleCommand(); | 28 virtual ~WindowHandleCommand(); |
| 27 | 29 |
| 28 virtual bool DoesGet(); | 30 virtual bool DoesGet(); |
| 29 virtual void ExecuteGet(Response* const response); | 31 virtual void ExecuteGet(Response* const response); |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(WindowHandleCommand); | 34 DISALLOW_COPY_AND_ASSIGN(WindowHandleCommand); |
| 33 }; | 35 }; |
| 34 | 36 |
| 35 // Gets a list of all window handles. | 37 // Gets a list of all window handles. |
| 36 // REST URL: /session/:sessionId/window_handles | 38 // REST URL: /session/:sessionId/window_handles |
| 37 class WindowHandlesCommand : public WebDriverCommand { | 39 class WindowHandlesCommand : public WebDriverCommand { |
| 38 public: | 40 public: |
| 39 WindowHandlesCommand(const std::vector<std::string>& path_segments, | 41 WindowHandlesCommand(const std::vector<std::string>& path_segments, |
| 40 DictionaryValue* parameters); | 42 base::DictionaryValue* parameters); |
| 41 virtual ~WindowHandlesCommand(); | 43 virtual ~WindowHandlesCommand(); |
| 42 | 44 |
| 43 virtual bool DoesGet(); | 45 virtual bool DoesGet(); |
| 44 virtual void ExecuteGet(Response* const response); | 46 virtual void ExecuteGet(Response* const response); |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(WindowHandlesCommand); | 49 DISALLOW_COPY_AND_ASSIGN(WindowHandlesCommand); |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 // Switches to the given window as the default window to execute commands on | 52 // Switches to the given window as the default window to execute commands on |
| 51 // or closes it. | 53 // or closes it. |
| 52 // REST URL: /session/:sessionId/window | 54 // REST URL: /session/:sessionId/window |
| 53 class WindowCommand : public WebDriverCommand { | 55 class WindowCommand : public WebDriverCommand { |
| 54 public: | 56 public: |
| 55 WindowCommand(const std::vector<std::string>& path_segments, | 57 WindowCommand(const std::vector<std::string>& path_segments, |
| 56 DictionaryValue* parameters); | 58 base::DictionaryValue* parameters); |
| 57 virtual ~WindowCommand(); | 59 virtual ~WindowCommand(); |
| 58 | 60 |
| 59 virtual bool DoesPost(); | 61 virtual bool DoesPost(); |
| 60 virtual bool DoesDelete(); | 62 virtual bool DoesDelete(); |
| 61 virtual void ExecutePost(Response* const response); | 63 virtual void ExecutePost(Response* const response); |
| 62 virtual void ExecuteDelete(Response* const response); | 64 virtual void ExecuteDelete(Response* const response); |
| 63 | 65 |
| 64 private: | 66 private: |
| 65 DISALLOW_COPY_AND_ASSIGN(WindowCommand); | 67 DISALLOW_COPY_AND_ASSIGN(WindowCommand); |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 // Switches to the given frame as the default frame to execute commands in. | 70 // Switches to the given frame as the default frame to execute commands in. |
| 69 // REST URL: /session/:sessionId/frame | 71 // REST URL: /session/:sessionId/frame |
| 70 class SwitchFrameCommand : public WebDriverCommand { | 72 class SwitchFrameCommand : public WebDriverCommand { |
| 71 public: | 73 public: |
| 72 SwitchFrameCommand(const std::vector<std::string>& path_segments, | 74 SwitchFrameCommand(const std::vector<std::string>& path_segments, |
| 73 DictionaryValue* parameters); | 75 base::DictionaryValue* parameters); |
| 74 virtual ~SwitchFrameCommand(); | 76 virtual ~SwitchFrameCommand(); |
| 75 | 77 |
| 76 virtual bool DoesPost(); | 78 virtual bool DoesPost(); |
| 77 virtual void ExecutePost(Response* const response); | 79 virtual void ExecutePost(Response* const response); |
| 78 | 80 |
| 79 private: | 81 private: |
| 80 bool GetWebElementParameter(const std::string& key, WebElementId* out) const; | 82 bool GetWebElementParameter(const std::string& key, WebElementId* out) const; |
| 81 | 83 |
| 82 DISALLOW_COPY_AND_ASSIGN(SwitchFrameCommand); | 84 DISALLOW_COPY_AND_ASSIGN(SwitchFrameCommand); |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 // Retrieves the active element on the current page. | 87 // Retrieves the active element on the current page. |
| 86 class ActiveElementCommand : public WebDriverCommand { | 88 class ActiveElementCommand : public WebDriverCommand { |
| 87 public: | 89 public: |
| 88 ActiveElementCommand(const std::vector<std::string>& path_segments, | 90 ActiveElementCommand(const std::vector<std::string>& path_segments, |
| 89 DictionaryValue* parameters); | 91 base::DictionaryValue* parameters); |
| 90 virtual ~ActiveElementCommand(); | 92 virtual ~ActiveElementCommand(); |
| 91 | 93 |
| 92 virtual bool DoesPost(); | 94 virtual bool DoesPost(); |
| 93 virtual void ExecutePost(Response* const response); | 95 virtual void ExecutePost(Response* const response); |
| 94 | 96 |
| 95 private: | 97 private: |
| 96 DISALLOW_COPY_AND_ASSIGN(ActiveElementCommand); | 98 DISALLOW_COPY_AND_ASSIGN(ActiveElementCommand); |
| 97 }; | 99 }; |
| 98 | 100 |
| 99 } // namespace webdriver | 101 } // namespace webdriver |
| 100 | 102 |
| 101 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_TARGET_LOCATOR_COMMANDS_H_ | 103 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_TARGET_LOCATOR_COMMANDS_H_ |
| OLD | NEW |