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

Unified Diff: chrome/test/webdriver/webdriver_capabilities_parser_unittest.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_unittest.cc
diff --git a/chrome/test/webdriver/webdriver_capabilities_parser_unittest.cc b/chrome/test/webdriver/webdriver_capabilities_parser_unittest.cc
index 085c0b9e2fe98ab3344d1d1d213b296514de30a9..0f01d790d1ed9d6be7cf412fa7144b39335da6e3 100644
--- a/chrome/test/webdriver/webdriver_capabilities_parser_unittest.cc
+++ b/chrome/test/webdriver/webdriver_capabilities_parser_unittest.cc
@@ -259,4 +259,23 @@ TEST(CapabilitiesParser, ProxyFtpServerCapNullValue) {
caps.command.GetSwitchValueASCII(switches::kProxyServer).c_str());
}
+// To demonstrate a bug (described:
+// http://code.google.com/p/chromedriver/issues/detail?id=75),
+// namely, that the driver logging preference should be of type Level, not
+// integer
+// (http://code.google.com/p/selenium/wiki/DesiredCapabilities#JSON_object)
+TEST(CapabilitiesParser, DriverLoggingCapString) {
+ Capabilities caps;
+ DictionaryValue dict;
+ DictionaryValue* options = new DictionaryValue();
+ dict.Set("loggingPrefs", options);
+ CapabilitiesParser parser(&dict, FilePath(), Logger(), &caps);
+
+ options->SetString("driver", "INFO");
+ ASSERT_FALSE(parser.Parse());
kkania 2012/05/21 17:46:46 i guess you wrote this test to demonstrate the bug
zori 2012/05/21 23:42:33 Since CapabilitiesParser::Parse() returns Error*,
+
+ options->SetInteger("driver", kInfoLogLevel);
kkania 2012/05/21 17:46:46 although people forget to all the time, technicall
zori 2012/05/21 23:42:33 I knew this, sorry. Done. On 2012/05/21 17:46:46,
+ ASSERT_TRUE(parser.Parse());
+}
+
} // namespace webdriver

Powered by Google App Engine
This is Rietveld 408576698