| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROME_COMMANDS_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_CHROME_COMMANDS_H_ |
| 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_CHROME_COMMANDS_H_ | 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_CHROME_COMMANDS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/test/webdriver/commands/webdriver_command.h" | 12 #include "chrome/test/webdriver/commands/webdriver_command.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class DictionaryValue; | 15 class DictionaryValue; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace webdriver { | 18 namespace webdriver { |
| 19 | 19 |
| 20 class Response; | 20 class Response; |
| 21 | 21 |
| 22 // Commands dealing with the extensions system. | 22 // Commands dealing with the extensions system. |
| 23 class ExtensionsCommand : public WebDriverCommand { | 23 class ExtensionsCommand : public WebDriverCommand { |
| 24 public: | 24 public: |
| 25 ExtensionsCommand(const std::vector<std::string>& path_segments, | 25 ExtensionsCommand(const std::vector<std::string>& path_segments, |
| 26 const base::DictionaryValue* const parameters); | 26 base::DictionaryValue* const parameters); |
| 27 virtual ~ExtensionsCommand(); | 27 virtual ~ExtensionsCommand(); |
| 28 | 28 |
| 29 virtual bool DoesGet() OVERRIDE; | 29 virtual bool DoesGet() OVERRIDE; |
| 30 virtual bool DoesPost() OVERRIDE; | 30 virtual bool DoesPost() OVERRIDE; |
| 31 | 31 |
| 32 // Returns all installed extensions. | 32 // Returns all installed extensions. |
| 33 virtual void ExecuteGet(Response* const response) OVERRIDE; | 33 virtual void ExecuteGet(Response* const response) OVERRIDE; |
| 34 | 34 |
| 35 // Installs an extension. | 35 // Installs an extension. |
| 36 virtual void ExecutePost(Response* const response) OVERRIDE; | 36 virtual void ExecutePost(Response* const response) OVERRIDE; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 DISALLOW_COPY_AND_ASSIGN(ExtensionsCommand); | 39 DISALLOW_COPY_AND_ASSIGN(ExtensionsCommand); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // Commands dealing with a particular extension. | 42 // Commands dealing with a particular extension. |
| 43 class ExtensionCommand : public WebDriverCommand { | 43 class ExtensionCommand : public WebDriverCommand { |
| 44 public: | 44 public: |
| 45 ExtensionCommand(const std::vector<std::string>& path_segments, | 45 ExtensionCommand(const std::vector<std::string>& path_segments, |
| 46 const base::DictionaryValue* const parameters); | 46 base::DictionaryValue* const parameters); |
| 47 virtual ~ExtensionCommand(); | 47 virtual ~ExtensionCommand(); |
| 48 | 48 |
| 49 virtual bool Init(Response* const response) OVERRIDE; | 49 virtual bool Init(Response* const response) OVERRIDE; |
| 50 | 50 |
| 51 virtual bool DoesGet() OVERRIDE; | 51 virtual bool DoesGet() OVERRIDE; |
| 52 virtual bool DoesPost() OVERRIDE; | 52 virtual bool DoesPost() OVERRIDE; |
| 53 virtual bool DoesDelete() OVERRIDE; | 53 virtual bool DoesDelete() OVERRIDE; |
| 54 | 54 |
| 55 // Returns information about the extension. | 55 // Returns information about the extension. |
| 56 virtual void ExecuteGet(Response* const response) OVERRIDE; | 56 virtual void ExecuteGet(Response* const response) OVERRIDE; |
| 57 | 57 |
| 58 // Modifies the extension. | 58 // Modifies the extension. |
| 59 virtual void ExecutePost(Response* const response) OVERRIDE; | 59 virtual void ExecutePost(Response* const response) OVERRIDE; |
| 60 | 60 |
| 61 // Uninstalls the extension. | 61 // Uninstalls the extension. |
| 62 virtual void ExecuteDelete(Response* const response) OVERRIDE; | 62 virtual void ExecuteDelete(Response* const response) OVERRIDE; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 std::string extension_id_; | 65 std::string extension_id_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(ExtensionCommand); | 67 DISALLOW_COPY_AND_ASSIGN(ExtensionCommand); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 // Commands dealing with targeting non-tab views. | 70 // Commands dealing with targeting non-tab views. |
| 71 class ViewsCommand : public WebDriverCommand { | 71 class ViewsCommand : public WebDriverCommand { |
| 72 public: | 72 public: |
| 73 ViewsCommand(const std::vector<std::string>& path_segments, | 73 ViewsCommand(const std::vector<std::string>& path_segments, |
| 74 const base::DictionaryValue* const parameters); | 74 base::DictionaryValue* const parameters); |
| 75 virtual ~ViewsCommand(); | 75 virtual ~ViewsCommand(); |
| 76 | 76 |
| 77 virtual bool DoesGet() OVERRIDE; | 77 virtual bool DoesGet() OVERRIDE; |
| 78 | 78 |
| 79 // Returns all open views. | 79 // Returns all open views. |
| 80 virtual void ExecuteGet(Response* const response) OVERRIDE; | 80 virtual void ExecuteGet(Response* const response) OVERRIDE; |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(ViewsCommand); | 83 DISALLOW_COPY_AND_ASSIGN(ViewsCommand); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 #if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) | 86 #if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) |
| 87 class HeapProfilerDumpCommand : public WebDriverCommand { | 87 class HeapProfilerDumpCommand : public WebDriverCommand { |
| 88 public: | 88 public: |
| 89 HeapProfilerDumpCommand(const std::vector<std::string>& path_segments, | 89 HeapProfilerDumpCommand(const std::vector<std::string>& path_segments, |
| 90 const base::DictionaryValue* const parameters); | 90 base::DictionaryValue* const parameters); |
| 91 virtual ~HeapProfilerDumpCommand(); | 91 virtual ~HeapProfilerDumpCommand(); |
| 92 | 92 |
| 93 virtual bool DoesPost() OVERRIDE; | 93 virtual bool DoesPost() OVERRIDE; |
| 94 virtual void ExecutePost(Response* const response) OVERRIDE; | 94 virtual void ExecutePost(Response* const response) OVERRIDE; |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 DISALLOW_COPY_AND_ASSIGN(HeapProfilerDumpCommand); | 97 DISALLOW_COPY_AND_ASSIGN(HeapProfilerDumpCommand); |
| 98 }; | 98 }; |
| 99 #endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) | 99 #endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) |
| 100 | 100 |
| 101 } // namespace webdriver | 101 } // namespace webdriver |
| 102 | 102 |
| 103 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_CHROME_COMMANDS_H_ | 103 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_CHROME_COMMANDS_H_ |
| OLD | NEW |