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

Side by Side Diff: chrome/test/chromedriver/capabilities.cc

Issue 605863002: [chromedriver] Allow excludesSwitches on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/test/chromedriver/capabilities.h" 5 #include "chrome/test/chromedriver/capabilities.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 base::Bind(&ParseString, &capabilities->android_activity); 382 base::Bind(&ParseString, &capabilities->android_activity);
383 parser_map["androidDeviceSerial"] = 383 parser_map["androidDeviceSerial"] =
384 base::Bind(&ParseString, &capabilities->android_device_serial); 384 base::Bind(&ParseString, &capabilities->android_device_serial);
385 parser_map["androidPackage"] = 385 parser_map["androidPackage"] =
386 base::Bind(&ParseString, &capabilities->android_package); 386 base::Bind(&ParseString, &capabilities->android_package);
387 parser_map["androidProcess"] = 387 parser_map["androidProcess"] =
388 base::Bind(&ParseString, &capabilities->android_process); 388 base::Bind(&ParseString, &capabilities->android_process);
389 parser_map["androidUseRunningApp"] = 389 parser_map["androidUseRunningApp"] =
390 base::Bind(&ParseBoolean, &capabilities->android_use_running_app); 390 base::Bind(&ParseBoolean, &capabilities->android_use_running_app);
391 parser_map["args"] = base::Bind(&ParseSwitches); 391 parser_map["args"] = base::Bind(&ParseSwitches);
392 parser_map["excludeSwitches"] = base::Bind(&ParseExcludeSwitches);
392 parser_map["loadAsync"] = base::Bind(&IgnoreDeprecatedOption, "loadAsync"); 393 parser_map["loadAsync"] = base::Bind(&IgnoreDeprecatedOption, "loadAsync");
393 } else if (is_remote) { 394 } else if (is_remote) {
394 parser_map["debuggerAddress"] = base::Bind(&ParseUseRemoteBrowser); 395 parser_map["debuggerAddress"] = base::Bind(&ParseUseRemoteBrowser);
395 } else { 396 } else {
396 parser_map["args"] = base::Bind(&ParseSwitches); 397 parser_map["args"] = base::Bind(&ParseSwitches);
397 parser_map["binary"] = base::Bind(&ParseFilePath, &capabilities->binary); 398 parser_map["binary"] = base::Bind(&ParseFilePath, &capabilities->binary);
398 parser_map["detach"] = base::Bind(&ParseBoolean, &capabilities->detach); 399 parser_map["detach"] = base::Bind(&ParseBoolean, &capabilities->detach);
399 parser_map["mobileEmulation"] = base::Bind(&ParseMobileEmulation);
400 parser_map["excludeSwitches"] = base::Bind(&ParseExcludeSwitches); 400 parser_map["excludeSwitches"] = base::Bind(&ParseExcludeSwitches);
401 parser_map["extensions"] = base::Bind(&ParseExtensions); 401 parser_map["extensions"] = base::Bind(&ParseExtensions);
402 parser_map["forceDevToolsScreenshot"] = base::Bind( 402 parser_map["forceDevToolsScreenshot"] = base::Bind(
403 &ParseBoolean, &capabilities->force_devtools_screenshot); 403 &ParseBoolean, &capabilities->force_devtools_screenshot);
404 parser_map["loadAsync"] = base::Bind(&IgnoreDeprecatedOption, "loadAsync"); 404 parser_map["loadAsync"] = base::Bind(&IgnoreDeprecatedOption, "loadAsync");
405 parser_map["localState"] = 405 parser_map["localState"] =
406 base::Bind(&ParseDict, &capabilities->local_state); 406 base::Bind(&ParseDict, &capabilities->local_state);
407 parser_map["logPath"] = base::Bind(&ParseLogPath); 407 parser_map["logPath"] = base::Bind(&ParseLogPath);
408 parser_map["minidumpPath"] = 408 parser_map["minidumpPath"] =
409 base::Bind(&ParseString, &capabilities->minidump_path); 409 base::Bind(&ParseString, &capabilities->minidump_path);
410 parser_map["mobileEmulation"] = base::Bind(&ParseMobileEmulation);
410 parser_map["prefs"] = base::Bind(&ParseDict, &capabilities->prefs); 411 parser_map["prefs"] = base::Bind(&ParseDict, &capabilities->prefs);
411 } 412 }
412 413
413 for (base::DictionaryValue::Iterator it(*chrome_options); !it.IsAtEnd(); 414 for (base::DictionaryValue::Iterator it(*chrome_options); !it.IsAtEnd();
414 it.Advance()) { 415 it.Advance()) {
415 if (parser_map.find(it.key()) == parser_map.end()) { 416 if (parser_map.find(it.key()) == parser_map.end()) {
416 return Status(kUnknownError, 417 return Status(kUnknownError,
417 "unrecognized chrome option: " + it.key()); 418 "unrecognized chrome option: " + it.key());
418 } 419 }
419 Status status = parser_map[it.key()].Run(it.value(), capabilities); 420 Status status = parser_map[it.key()].Run(it.value(), capabilities);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 if (iter == logging_prefs.end() || iter->second == Log::kOff) { 579 if (iter == logging_prefs.end() || iter->second == Log::kOff) {
579 const base::DictionaryValue* chrome_options = NULL; 580 const base::DictionaryValue* chrome_options = NULL;
580 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) && 581 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) &&
581 chrome_options->HasKey("perfLoggingPrefs")) { 582 chrome_options->HasKey("perfLoggingPrefs")) {
582 return Status(kUnknownError, "perfLoggingPrefs specified, " 583 return Status(kUnknownError, "perfLoggingPrefs specified, "
583 "but performance logging was not enabled"); 584 "but performance logging was not enabled");
584 } 585 }
585 } 586 }
586 return Status(kOk); 587 return Status(kOk);
587 } 588 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698