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 #include "chrome/test/webdriver/commands/command.h" | 5 #include "chrome/test/webdriver/commands/command.h" |
6 | 6 |
7 namespace webdriver { | 7 namespace webdriver { |
8 | 8 |
9 Command::Command(const std::vector<std::string>& path_segments, | 9 Command::Command(const std::vector<std::string>& path_segments, |
10 const DictionaryValue* const parameters) | 10 const DictionaryValue* const parameters) |
(...skipping 23 matching lines...) Expand all Loading... | |
34 } | 34 } |
35 | 35 |
36 bool Command::HasParameter(const std::string& key) const { | 36 bool Command::HasParameter(const std::string& key) const { |
37 return parameters_.get() && parameters_->HasKey(key); | 37 return parameters_.get() && parameters_->HasKey(key); |
38 } | 38 } |
39 | 39 |
40 bool Command::IsNullParameter(const std::string& key) const { | 40 bool Command::IsNullParameter(const std::string& key) const { |
41 Value* value; | 41 Value* value; |
42 return parameters_.get() && | 42 return parameters_.get() && |
43 parameters_->Get(key, &value) && | 43 parameters_->Get(key, &value) && |
44 value->IsType(Value::TYPE_NULL); | 44 value->IsNull(); |
tony
2011/08/19 17:24:21
Nit: Maybe we can fit this on 2 lines? Also, the
tfarina
2011/08/19 18:40:47
Done.
| |
45 } | 45 } |
46 | 46 |
47 bool Command::GetStringParameter(const std::string& key, | 47 bool Command::GetStringParameter(const std::string& key, |
48 string16* out) const { | 48 string16* out) const { |
49 return parameters_.get() != NULL && parameters_->GetString(key, out); | 49 return parameters_.get() != NULL && parameters_->GetString(key, out); |
50 } | 50 } |
51 | 51 |
52 bool Command::GetStringParameter(const std::string& key, | 52 bool Command::GetStringParameter(const std::string& key, |
53 std::string* out) const { | 53 std::string* out) const { |
54 return parameters_.get() != NULL && parameters_->GetString(key, out); | 54 return parameters_.get() != NULL && parameters_->GetString(key, out); |
(...skipping 22 matching lines...) Expand all Loading... | |
77 DictionaryValue** out) const { | 77 DictionaryValue** out) const { |
78 return parameters_.get() != NULL && parameters_->GetDictionary(key, out); | 78 return parameters_.get() != NULL && parameters_->GetDictionary(key, out); |
79 } | 79 } |
80 | 80 |
81 bool Command::GetListParameter(const std::string& key, | 81 bool Command::GetListParameter(const std::string& key, |
82 ListValue** out) const { | 82 ListValue** out) const { |
83 return parameters_.get() != NULL && parameters_->GetList(key, out); | 83 return parameters_.get() != NULL && parameters_->GetList(key, out); |
84 } | 84 } |
85 | 85 |
86 } // namespace webdriver | 86 } // namespace webdriver |
OLD | NEW |