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

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

Issue 2730783002: [chromedriver] Use disable-extensions-except on Windows and Mac. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome_launcher.cc
diff --git a/chrome/test/chromedriver/chrome_launcher.cc b/chrome/test/chromedriver/chrome_launcher.cc
index 567637e8b6466ca68c2d386376f7008012edd8ed..1592c2913c813c10936865934ba31f80edf66884 100644
--- a/chrome/test/chromedriver/chrome_launcher.cc
+++ b/chrome/test/chromedriver/chrome_launcher.cc
@@ -775,24 +775,25 @@ Status ProcessExtensions(const std::vector<std::string>& extensions,
Status status = UnpackAutomationExtension(temp_dir, &automation_extension);
if (status.IsError())
return status;
-#if defined(OS_WIN) || defined(OS_MACOSX)
- // On Chrome for Windows and Mac, a "Disable developer mode extensions"
- // dialog appears for the automation extension. Suppress this by loading
- // it as a component extension.
- UpdateExtensionSwitch(switches, "load-component-extension",
- automation_extension.value());
-#else
if (switches->HasSwitch("disable-extensions")) {
- // For Chrome 56 and earlier:
- UpdateExtensionSwitch(switches, "load-component-extension",
- automation_extension.value());
- // For Chrome 57 and later:
UpdateExtensionSwitch(switches, "disable-extensions-except",
automation_extension.value());
+ // TODO(samuong): Stop using --load-component-extension when ChromeDriver
+ // stops supporting Chrome 56. For backwards compatibility, Chrome 57 and
+ // 58 interprets --load-component-extension as --load-extension.
+ UpdateExtensionSwitch(switches, "load-component-extension",
+ automation_extension.value());
} else {
+#if defined(OS_WIN) || defined(OS_MACOSX)
+ // On Chrome 56 for Windows and Mac, a "Disable developer
+ // mode extensions" dialog appears for the automation extension. Suppress
+ // this by loading it as a component extension.
+ UpdateExtensionSwitch(switches, "load-component-extension",
+ automation_extension.value());
+#else
extension_paths.push_back(automation_extension.value());
- }
#endif
+ }
}
if (extension_paths.size()) {
« 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