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_COMMAND_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ |
6 #define CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ | 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 bool GetStringASCIIParameter(const std::string& key, std::string* out) const; | 67 bool GetStringASCIIParameter(const std::string& key, std::string* out) const; |
68 | 68 |
69 // Returns the command parameter with the given |key| as a boolean. Returns | 69 // Returns the command parameter with the given |key| as a boolean. Returns |
70 // false if there is no such parameter, or if it is not a boolean. | 70 // false if there is no such parameter, or if it is not a boolean. |
71 bool GetBooleanParameter(const std::string& key, bool* out) const; | 71 bool GetBooleanParameter(const std::string& key, bool* out) const; |
72 | 72 |
73 // Returns the command parameter with the given |key| as a int. Returns | 73 // Returns the command parameter with the given |key| as a int. Returns |
74 // false if there is no such parameter, or if it is not a int. | 74 // false if there is no such parameter, or if it is not a int. |
75 bool GetIntegerParameter(const std::string& key, int* out) const; | 75 bool GetIntegerParameter(const std::string& key, int* out) const; |
76 | 76 |
77 // Returns the command parameter with the given |key| as a Dictionary. | |
John Grabowski
2011/02/14 21:59:06
Returns --> Provides, or "Get" (so it's not confus
Joe
2011/02/15 02:30:48
Done.
Joe
2011/02/15 02:30:48
Done.
| |
78 // Returns false if there is no such parameter, or if it is not a Dictionary. | |
79 bool GetDictionaryParameter(const std::string& key, | |
80 DictionaryValue** out) const; | |
81 | |
77 private: | 82 private: |
78 const std::vector<std::string> path_segments_; | 83 const std::vector<std::string> path_segments_; |
79 const scoped_ptr<const DictionaryValue> parameters_; | 84 const scoped_ptr<const DictionaryValue> parameters_; |
80 | 85 |
81 // An autorelease pool must exist on any thread where Objective C is used, | 86 // An autorelease pool must exist on any thread where Objective C is used, |
82 // even implicitly. Otherwise the warning: | 87 // even implicitly. Otherwise the warning: |
83 // "Objects autoreleased with no pool in place." | 88 // "Objects autoreleased with no pool in place." |
84 // is printed for every object deallocted. Since every incomming command to | 89 // is printed for every object deallocted. Since every incomming command to |
85 // chrome driver is allocated a new thread, the release pool is declared here. | 90 // chrome driver is allocated a new thread, the release pool is declared here. |
86 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 91 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
87 | 92 |
88 DISALLOW_COPY_AND_ASSIGN(Command); | 93 DISALLOW_COPY_AND_ASSIGN(Command); |
89 }; | 94 }; |
90 | 95 |
91 } // namespace webdriver | 96 } // namespace webdriver |
92 | 97 |
93 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ | 98 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ |
94 | 99 |
OLD | NEW |