| 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 // Error message taken from: | 9 // Error message taken from: |
| 10 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes | 10 // http://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool Command::DoesPost() { | 35 bool Command::DoesPost() { |
| 36 return false; | 36 return false; |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool Command::Init(Response* const response) { | 39 bool Command::Init(Response* const response) { |
| 40 return true; | 40 return true; |
| 41 } | 41 } |
| 42 | 42 |
| 43 bool Command::IsNullParameter(const std::string& key) const { |
| 44 Value* value; |
| 45 return parameters_.get() && |
| 46 parameters_->Get(key, &value) && |
| 47 value->IsType(Value::TYPE_NULL); |
| 48 } |
| 49 |
| 43 bool Command::GetStringParameter(const std::string& key, | 50 bool Command::GetStringParameter(const std::string& key, |
| 44 string16* out) const { | 51 string16* out) const { |
| 45 return parameters_.get() != NULL && parameters_->GetString(key, out); | 52 return parameters_.get() != NULL && parameters_->GetString(key, out); |
| 46 } | 53 } |
| 47 | 54 |
| 48 bool Command::GetStringParameter(const std::string& key, | 55 bool Command::GetStringParameter(const std::string& key, |
| 49 std::string* out) const { | 56 std::string* out) const { |
| 50 return parameters_.get() != NULL && parameters_->GetString(key, out); | 57 return parameters_.get() != NULL && parameters_->GetString(key, out); |
| 51 } | 58 } |
| 52 | 59 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 64 int* out) const { | 71 int* out) const { |
| 65 return parameters_.get() != NULL && parameters_->GetInteger(key, out); | 72 return parameters_.get() != NULL && parameters_->GetInteger(key, out); |
| 66 } | 73 } |
| 67 | 74 |
| 68 bool Command::GetListParameter(const std::string& key, | 75 bool Command::GetListParameter(const std::string& key, |
| 69 ListValue** out) const { | 76 ListValue** out) const { |
| 70 return parameters_.get() != NULL && parameters_->GetList(key, out); | 77 return parameters_.get() != NULL && parameters_->GetList(key, out); |
| 71 } | 78 } |
| 72 | 79 |
| 73 } // namespace webdriver | 80 } // namespace webdriver |
| 74 | |
| OLD | NEW |