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

Unified Diff: chrome/test/chromedriver/capabilities.cc

Issue 14263024: Logging API in chromedriver2. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « chrome/test/chromedriver/capabilities.h ('k') | chrome/test/chromedriver/capabilities_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/capabilities.cc
===================================================================
--- chrome/test/chromedriver/capabilities.cc (revision 194993)
+++ chrome/test/chromedriver/capabilities.cc (working copy)
@@ -201,6 +201,21 @@
return Status(kOk);
}
+Status ParseLoggingPrefs(const base::DictionaryValue& desired_caps,
+ Capabilities* capabilities) {
+ const base::Value* logging_prefs = NULL;
+ if (desired_caps.Get("loggingPrefs", &logging_prefs)) {
+ const base::DictionaryValue* logging_prefs_dict = NULL;
+ if (!logging_prefs->GetAsDictionary(&logging_prefs_dict)) {
+ return Status(kUnknownError, "'loggingPrefs' must be a dictionary");
+ }
+ // TODO(klm): verify log types.
+ // TODO(klm): verify log levels.
+ capabilities->logging_prefs.reset(logging_prefs_dict->DeepCopy());
+ }
+ return Status(kOk);
+}
+
} // namespace
Capabilities::Capabilities() : command(CommandLine::NO_PROGRAM) {}
@@ -212,9 +227,12 @@
}
Status Capabilities::Parse(const base::DictionaryValue& desired_caps) {
- Status status = ParseAndroidChromeCapabilities(desired_caps, this);
+ Status status = ParseLoggingPrefs(desired_caps, this);
if (status.IsError())
return status;
+ status = ParseAndroidChromeCapabilities(desired_caps, this);
+ if (status.IsError())
+ return status;
if (IsAndroid())
return Status(kOk);
« no previous file with comments | « chrome/test/chromedriver/capabilities.h ('k') | chrome/test/chromedriver/capabilities_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698