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_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 class ExtensionsCommand : public WebDriverCommand { | 23 class ExtensionsCommand : public WebDriverCommand { |
23 public: | 24 public: |
24 ExtensionsCommand(const std::vector<std::string>& path_segments, | 25 ExtensionsCommand(const std::vector<std::string>& path_segments, |
25 const base::DictionaryValue* const parameters); | 26 const base::DictionaryValue* const parameters); |
26 virtual ~ExtensionsCommand(); | 27 virtual ~ExtensionsCommand(); |
27 | 28 |
28 virtual bool DoesGet() OVERRIDE; | 29 virtual bool DoesGet() OVERRIDE; |
29 virtual bool DoesPost() OVERRIDE; | 30 virtual bool DoesPost() OVERRIDE; |
30 | 31 |
32 // Returns all installed extensions. | |
31 virtual void ExecuteGet(Response* const response) OVERRIDE; | 33 virtual void ExecuteGet(Response* const response) OVERRIDE; |
34 | |
35 // Installs an extension. | |
32 virtual void ExecutePost(Response* const response) OVERRIDE; | 36 virtual void ExecutePost(Response* const response) OVERRIDE; |
33 | 37 |
34 private: | 38 private: |
35 DISALLOW_COPY_AND_ASSIGN(ExtensionsCommand); | 39 DISALLOW_COPY_AND_ASSIGN(ExtensionsCommand); |
36 }; | 40 }; |
37 | 41 |
42 // Commands dealing with a particular extension. | |
43 class ExtensionCommand : public WebDriverCommand { | |
44 public: | |
45 ExtensionCommand(const std::vector<std::string>& path_segments, | |
46 const base::DictionaryValue* const parameters); | |
47 virtual ~ExtensionCommand(); | |
48 | |
49 virtual bool Init(Response* const response) OVERRIDE; | |
50 | |
51 virtual bool DoesGet() OVERRIDE; | |
52 virtual bool DoesPost() OVERRIDE; | |
53 virtual bool DoesDelete() OVERRIDE; | |
54 | |
55 // Returns information about the extension. | |
56 virtual void ExecuteGet(Response* const response) OVERRIDE; | |
57 | |
58 // Modifies the extension. | |
59 virtual void ExecutePost(Response* const response) OVERRIDE; | |
60 | |
61 // Uninstalls the extension. | |
62 virtual void ExecuteDelete(Response* const response) OVERRIDE; | |
63 | |
64 private: | |
65 std::string extension_id_; | |
66 | |
67 DISALLOW_COPY_AND_ASSIGN(ExtensionCommand); | |
68 }; | |
69 | |
70 // Commands dealing with targeting non-tab views. | |
71 class ViewsCommand : public WebDriverCommand { | |
72 public: | |
73 ViewsCommand(const std::vector<std::string>& path_segments, | |
74 const base::DictionaryValue* const parameters); | |
75 virtual ~ViewsCommand(); | |
76 | |
77 virtual bool DoesGet() OVERRIDE; | |
78 | |
79 virtual void ExecuteGet(Response* const response) OVERRIDE; | |
Huyen
2011/12/08 02:10:32
maybe add comments stating this method gets all th
kkania
2011/12/08 17:31:21
Done.
| |
80 | |
81 private: | |
82 DISALLOW_COPY_AND_ASSIGN(ViewsCommand); | |
83 }; | |
84 | |
38 } // namespace webdriver | 85 } // namespace webdriver |
39 | 86 |
40 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_CHROME_COMMANDS_H_ | 87 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_CHROME_COMMANDS_H_ |
OLD | NEW |