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

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

Issue 2552093003: [chromedriver] Replace "--load-component-extension" with "--disable-extensions-except" switch.
Patch Set: Created 4 years 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/chrome_launcher.h" 5 #include "chrome/test/chromedriver/chrome_launcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 775
776 if (include_automation_extension) { 776 if (include_automation_extension) {
777 base::FilePath automation_extension; 777 base::FilePath automation_extension;
778 Status status = UnpackAutomationExtension(temp_dir, &automation_extension); 778 Status status = UnpackAutomationExtension(temp_dir, &automation_extension);
779 if (status.IsError()) 779 if (status.IsError())
780 return status; 780 return status;
781 #if defined(OS_WIN) || defined(OS_MACOSX) 781 #if defined(OS_WIN) || defined(OS_MACOSX)
782 // On Chrome for Windows and Mac, a "Disable developer mode extensions" 782 // On Chrome for Windows and Mac, a "Disable developer mode extensions"
783 // dialog appears for the automation extension. Suppress this by loading 783 // dialog appears for the automation extension. Suppress this by loading
784 // it as a component extension. 784 // it as a component extension.
785 UpdateExtensionSwitch(switches, "load-component-extension", 785 UpdateExtensionSwitch(switches, "disable-extensions-except",
786 automation_extension.value()); 786 automation_extension.value());
787 #else 787 #else
788 if (switches->HasSwitch("disable-extensions")) { 788 if (switches->HasSwitch("disable-extensions")) {
789 UpdateExtensionSwitch(switches, "load-component-extension", 789 UpdateExtensionSwitch(switches, "disable-extensions-except",
790 automation_extension.value()); 790 automation_extension.value());
791 } else { 791 } else {
792 extension_paths.push_back(automation_extension.value()); 792 extension_paths.push_back(automation_extension.value());
793 } 793 }
794 #endif 794 #endif
795 } 795 }
796 796
797 if (extension_paths.size()) { 797 if (extension_paths.size()) {
798 base::FilePath::StringType extension_paths_value = base::JoinString( 798 base::FilePath::StringType extension_paths_value = base::JoinString(
799 extension_paths, base::FilePath::StringType(1, ',')); 799 extension_paths, base::FilePath::StringType(1, ','));
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 // Write empty "First Run" file, otherwise Chrome will wipe the default 879 // Write empty "First Run" file, otherwise Chrome will wipe the default
880 // profile that was written. 880 // profile that was written.
881 if (base::WriteFile( 881 if (base::WriteFile(
882 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) { 882 user_data_dir.Append(chrome::kFirstRunSentinel), "", 0) != 0) {
883 return Status(kUnknownError, "failed to write first run file"); 883 return Status(kUnknownError, "failed to write first run file");
884 } 884 }
885 return Status(kOk); 885 return Status(kOk);
886 } 886 }
887 887
888 } // namespace internal 888 } // namespace internal
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