Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: chrome/test/webdriver/commands/command.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/test/ui/javascript_test_util.cc ('k') | chrome/test/webdriver/commands/set_timeout_commands_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698