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

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

Issue 2776313003: Update ChromeDriver to accept W3C format InitSession (Closed)
Patch Set: Created 3 years, 9 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/client/chromedriver.py ('k') | chrome/test/chromedriver/test/run_py_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/session_commands.cc
diff --git a/chrome/test/chromedriver/session_commands.cc b/chrome/test/chromedriver/session_commands.cc
index 1a39f53bc3a0574e07e8fb9e9ea019677c0ae3ee..a19a231ff924c39c23fe256dd973e96712937bfd 100644
--- a/chrome/test/chromedriver/session_commands.cc
+++ b/chrome/test/chromedriver/session_commands.cc
@@ -176,14 +176,18 @@ Status InitSessionHelper(const InitSessionParams& bound_params,
session->driver_log.reset(
new WebDriverLog(WebDriverLog::kDriverType, Log::kAll));
const base::DictionaryValue* desired_caps;
- bool w3c_capability = false;
- if (params.GetDictionary("capabilities.desiredCapabilities", &desired_caps)
- && desired_caps->GetBoolean("chromeOptions.w3c", &w3c_capability)
- && w3c_capability)
+ const base::DictionaryValue default_desired_caps;
samuong 2017/03/28 21:30:00 What is the difference between |desired_caps| and
+ if (params.GetDictionary("desiredCapabilities", &desired_caps) ||
+ params.GetDictionary("capabilities.desiredCapabilities", &desired_caps)) {
samuong 2017/03/28 21:30:00 If we're going to continue supporting capabilties.
+ } else if (params.GetDictionary("capabilities", nullptr)) {
session->w3c_compliant = true;
- else if (!params.GetDictionary("desiredCapabilities", &desired_caps) &&
- !params.GetDictionary("capabilities.desiredCapabilities", &desired_caps))
- return Status(kUnknownError, "cannot find dict 'desiredCapabilities'");
+ if (!params.GetDictionary("capabilities.alwaysMatch", &desired_caps))
+ desired_caps = &default_desired_caps;
+ // TBD: Handle capabilities.firstMatch.
+ } else {
+ return Status(kUnknownError,
+ "cannot find dict 'capabilities' or 'desiredCapabilities'");
samuong 2017/03/28 21:30:00 This error message needs to be updated
+ }
Capabilities capabilities;
Status status = capabilities.Parse(*desired_caps);
« no previous file with comments | « chrome/test/chromedriver/client/chromedriver.py ('k') | chrome/test/chromedriver/test/run_py_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698