| 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 21 matching lines...) Expand all Loading... |
| 32 std::string Command::GetPathVariable(const size_t i) const { | 32 std::string Command::GetPathVariable(const size_t i) const { |
| 33 return i < path_segments_.size() ? path_segments_.at(i) : ""; | 33 return i < path_segments_.size() ? path_segments_.at(i) : ""; |
| 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() && parameters_->Get(key, &value) && value->IsNull(); |
| 43 parameters_->Get(key, &value) && | |
| 44 value->IsType(Value::TYPE_NULL); | |
| 45 } | 43 } |
| 46 | 44 |
| 47 bool Command::GetStringParameter(const std::string& key, | 45 bool Command::GetStringParameter(const std::string& key, |
| 48 string16* out) const { | 46 string16* out) const { |
| 49 return parameters_.get() != NULL && parameters_->GetString(key, out); | 47 return parameters_.get() != NULL && parameters_->GetString(key, out); |
| 50 } | 48 } |
| 51 | 49 |
| 52 bool Command::GetStringParameter(const std::string& key, | 50 bool Command::GetStringParameter(const std::string& key, |
| 53 std::string* out) const { | 51 std::string* out) const { |
| 54 return parameters_.get() != NULL && parameters_->GetString(key, out); | 52 return parameters_.get() != NULL && parameters_->GetString(key, out); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 77 DictionaryValue** out) const { | 75 DictionaryValue** out) const { |
| 78 return parameters_.get() != NULL && parameters_->GetDictionary(key, out); | 76 return parameters_.get() != NULL && parameters_->GetDictionary(key, out); |
| 79 } | 77 } |
| 80 | 78 |
| 81 bool Command::GetListParameter(const std::string& key, | 79 bool Command::GetListParameter(const std::string& key, |
| 82 ListValue** out) const { | 80 ListValue** out) const { |
| 83 return parameters_.get() != NULL && parameters_->GetList(key, out); | 81 return parameters_.get() != NULL && parameters_->GetList(key, out); |
| 84 } | 82 } |
| 85 | 83 |
| 86 } // namespace webdriver | 84 } // namespace webdriver |
| OLD | NEW |