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

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

Issue 23643005: [chromedriver] Load the automation extension as a component extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 years, 3 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/chrome_launcher.h" 5 #include "chrome/test/chromedriver/chrome_launcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 extension_paths.push_back(path.value()); 513 extension_paths.push_back(path.value());
514 if (bg_page.length()) 514 if (bg_page.length())
515 bg_pages_tmp.push_back(bg_page); 515 bg_pages_tmp.push_back(bg_page);
516 } 516 }
517 517
518 if (include_automation_extension) { 518 if (include_automation_extension) {
519 base::FilePath automation_extension; 519 base::FilePath automation_extension;
520 Status status = UnpackAutomationExtension(temp_dir, &automation_extension); 520 Status status = UnpackAutomationExtension(temp_dir, &automation_extension);
521 if (status.IsError()) 521 if (status.IsError())
522 return status; 522 return status;
523 if (command->HasSwitch("disable-extensions")) { 523 command->AppendSwitchNative("load-component-extension",
chrisgao (Use stgao instead) 2013/08/28 17:01:58 If the users pass in an argument "--load-component
524 command->AppendSwitchNative("load-component-extension", 524 automation_extension.value());
525 automation_extension.value());
526 } else {
527 extension_paths.push_back(automation_extension.value());
528 }
529 } 525 }
530 526
531 if (extension_paths.size()) { 527 if (extension_paths.size()) {
532 base::FilePath::StringType extension_paths_value = JoinString( 528 base::FilePath::StringType extension_paths_value = JoinString(
533 extension_paths, FILE_PATH_LITERAL(',')); 529 extension_paths, FILE_PATH_LITERAL(','));
534 command->AppendSwitchNative("load-extension", extension_paths_value); 530 command->AppendSwitchNative("load-extension", extension_paths_value);
535 } 531 }
536 bg_pages->swap(bg_pages_tmp); 532 bg_pages->swap(bg_pages_tmp);
537 return Status(kOk); 533 return Status(kOk);
538 } 534 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 // Write empty "First Run" file, otherwise Chrome will wipe the default 588 // Write empty "First Run" file, otherwise Chrome will wipe the default
593 // profile that was written. 589 // profile that was written.
594 if (file_util::WriteFile( 590 if (file_util::WriteFile(
595 user_data_dir.AppendASCII("First Run"), "", 0) != 0) { 591 user_data_dir.AppendASCII("First Run"), "", 0) != 0) {
596 return Status(kUnknownError, "failed to write first run file"); 592 return Status(kUnknownError, "failed to write first run file");
597 } 593 }
598 return Status(kOk); 594 return Status(kOk);
599 } 595 }
600 596
601 } // namespace internal 597 } // 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