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

Unified Diff: chrome/test/webdriver/webdriver_capabilities_parser.cc

Issue 10411031: Fixing loglevel in chrome driver to accept string rather than an integer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/webdriver/webdriver_capabilities_parser.cc
diff --git a/chrome/test/webdriver/webdriver_capabilities_parser.cc b/chrome/test/webdriver/webdriver_capabilities_parser.cc
index 579d660610418ad62f44701351858c830320168a..5e387ee294c419d307083c8e0565d3b2ce987dc1 100644
--- a/chrome/test/webdriver/webdriver_capabilities_parser.cc
+++ b/chrome/test/webdriver/webdriver_capabilities_parser.cc
@@ -11,6 +11,7 @@
#include "base/values.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/webdriver/webdriver_error.h"
+#include "chrome/test/webdriver/webdriver_logging.h"
#include "chrome/test/webdriver/webdriver_util.h"
using base::DictionaryValue;
@@ -239,14 +240,14 @@ Error* CapabilitiesParser::ParseLoggingPrefs(const base::Value* option) {
Value* level_value;
logging_prefs->Get(*key_iter, &level_value);
- int level;
- if (!level_value->GetAsInteger(&level)) {
+ std::string level_name;
+ if (!level_value->GetAsString(&level_name)) {
return CreateBadInputError(
std::string("loggingPrefs.") + *key_iter,
- Value::TYPE_INTEGER,
+ Value::TYPE_STRING,
level_value);
}
- caps_->log_levels[log_type.type()] = static_cast<LogLevel>(level);
+ caps_->log_levels[log_type.type()] = LogLevelFromString(level_name);
}
return NULL;
}
@@ -338,7 +339,7 @@ Error* CapabilitiesParser::ParseProxy(const base::Value* option) {
}
Error* CapabilitiesParser::ParseProxyAutoDetect(
- const DictionaryValue* options){
+ const DictionaryValue* options) {
const char kProxyAutoDetectKey[] = "autodetect";
bool proxy_auto_detect = false;
if (!options->GetBoolean(kProxyAutoDetectKey, &proxy_auto_detect))

Powered by Google App Engine
This is Rietveld 408576698