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

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

Issue 2743013002: Add webdriver endpoint to send custom debugger commands (Closed)
Patch Set: Adding stub, quick code reorg Created 3 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
« no previous file with comments | « chrome/test/chromedriver/capabilities.h ('k') | chrome/test/chromedriver/chrome/stub_web_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/capabilities.cc
diff --git a/chrome/test/chromedriver/capabilities.cc b/chrome/test/chromedriver/capabilities.cc
index a9bafc91ee785b5b2bdb63a6ea797df6b402e923..c10ce6003a60a17e916823fdcc02805a527f2502 100644
--- a/chrome/test/chromedriver/capabilities.cc
+++ b/chrome/test/chromedriver/capabilities.cc
@@ -400,6 +400,18 @@ Status ParsePerfLoggingPrefs(const base::Value& option,
return Status(kOk);
}
+Status ParseDevToolsEventsLoggingPrefs(const base::Value& option,
+ Capabilities* capabilities) {
+ const base::ListValue* devtools_events_logging_prefs = nullptr;
+ if (!option.GetAsList(&devtools_events_logging_prefs))
+ return Status(kUnknownError, "must be a list");
+ if (devtools_events_logging_prefs->empty())
+ return Status(kUnknownError, "list must contain values");
+ capabilities->devtools_events_logging_prefs.reset(
+ devtools_events_logging_prefs->DeepCopy());
+ return Status(kOk);
+}
+
Status ParseWindowTypes(const base::Value& option, Capabilities* capabilities) {
const base::ListValue* window_types = NULL;
if (!option.GetAsList(&window_types))
@@ -438,6 +450,8 @@ Status ParseChromeOptions(
parser_map["extensions"] = base::Bind(&IgnoreCapability);
parser_map["perfLoggingPrefs"] = base::Bind(&ParsePerfLoggingPrefs);
+ parser_map["devToolsEventsToLog"] = base::Bind(
+ &ParseDevToolsEventsLoggingPrefs);
parser_map["windowTypes"] = base::Bind(&ParseWindowTypes);
// Compliance is read when session is initialized and correct response is
// sent if not parsed correctly.
@@ -666,5 +680,16 @@ Status Capabilities::Parse(const base::DictionaryValue& desired_caps) {
"but performance logging was not enabled");
}
}
+ LoggingPrefs::const_iterator dt_events_logging_iter = logging_prefs.find(
+ WebDriverLog::kDevToolsType);
+ if (dt_events_logging_iter == logging_prefs.end()
+ || dt_events_logging_iter->second == Log::kOff) {
+ const base::DictionaryValue* chrome_options = NULL;
+ if (desired_caps.GetDictionary("chromeOptions", &chrome_options) &&
+ chrome_options->HasKey("devToolsEventsToLog")) {
+ return Status(kUnknownError, "devToolsEventsToLog specified, "
+ "but devtools events logging was not enabled");
+ }
+ }
return Status(kOk);
}
« no previous file with comments | « chrome/test/chromedriver/capabilities.h ('k') | chrome/test/chromedriver/chrome/stub_web_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698