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

Side by Side 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 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 "base/base64.h" 5 #include "base/base64.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/scoped_temp_dir.h" 8 #include "base/scoped_temp_dir.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 options->SetString("proxyType", "manual"); 252 options->SetString("proxyType", "manual");
253 options->SetString("httpProxy", "localhost:8001"); 253 options->SetString("httpProxy", "localhost:8001");
254 options->Set("ftpProxy", Value::CreateNullValue()); 254 options->Set("ftpProxy", Value::CreateNullValue());
255 255
256 CapabilitiesParser parser(&dict, FilePath(), Logger(), &caps); 256 CapabilitiesParser parser(&dict, FilePath(), Logger(), &caps);
257 ASSERT_FALSE(parser.Parse()); 257 ASSERT_FALSE(parser.Parse());
258 EXPECT_STREQ("http=localhost:8001", 258 EXPECT_STREQ("http=localhost:8001",
259 caps.command.GetSwitchValueASCII(switches::kProxyServer).c_str()); 259 caps.command.GetSwitchValueASCII(switches::kProxyServer).c_str());
260 } 260 }
261 261
262 // To demonstrate a bug (described:
263 // http://code.google.com/p/chromedriver/issues/detail?id=75),
264 // namely, that the driver logging preference should be of type Level, not
265 // integer
266 // (http://code.google.com/p/selenium/wiki/DesiredCapabilities#JSON_object)
267 TEST(CapabilitiesParser, DriverLoggingCapString) {
268 Capabilities caps;
269 DictionaryValue dict;
270 DictionaryValue* options = new DictionaryValue();
271 dict.Set("loggingPrefs", options);
272 CapabilitiesParser parser(&dict, FilePath(), Logger(), &caps);
273
274 options->SetString("driver", "INFO");
275 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*,
276
277 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,
278 ASSERT_TRUE(parser.Parse());
279 }
280
262 } // namespace webdriver 281 } // namespace webdriver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698