OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/extensions/extension_browsertest.h" | 5 #include "chrome/browser/extensions/extension_browsertest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 } | 489 } |
490 if (crx_path.empty()) | 490 if (crx_path.empty()) |
491 return NULL; | 491 return NULL; |
492 | 492 |
493 scoped_ptr<ExtensionInstallPrompt> install_ui; | 493 scoped_ptr<ExtensionInstallPrompt> install_ui; |
494 if (prompt_auto_confirm) { | 494 if (prompt_auto_confirm) { |
495 install_ui.reset(new ExtensionInstallPrompt( | 495 install_ui.reset(new ExtensionInstallPrompt( |
496 browser->tab_strip_model()->GetActiveWebContents())); | 496 browser->tab_strip_model()->GetActiveWebContents())); |
497 } | 497 } |
498 scoped_refptr<extensions::CrxInstaller> installer( | 498 scoped_refptr<extensions::CrxInstaller> installer( |
499 extensions::CrxInstaller::Create(service, install_ui.Pass())); | 499 extensions::CrxInstaller::Create(service, std::move(install_ui))); |
500 installer->set_expected_id(id); | 500 installer->set_expected_id(id); |
501 installer->set_creation_flags(creation_flags); | 501 installer->set_creation_flags(creation_flags); |
502 installer->set_install_source(install_source); | 502 installer->set_install_source(install_source); |
503 installer->set_install_immediately(install_immediately); | 503 installer->set_install_immediately(install_immediately); |
504 if (!installer->is_gallery_install()) { | 504 if (!installer->is_gallery_install()) { |
505 installer->set_off_store_install_allow_reason( | 505 installer->set_off_store_install_allow_reason( |
506 extensions::CrxInstaller::OffStoreInstallAllowedInTest); | 506 extensions::CrxInstaller::OffStoreInstallAllowedInTest); |
507 } | 507 } |
508 | 508 |
509 observer_->Watch( | 509 observer_->Watch( |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( | 654 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( |
655 profile(), extension_id, script); | 655 profile(), extension_id, script); |
656 } | 656 } |
657 | 657 |
658 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( | 658 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( |
659 const std::string& extension_id, | 659 const std::string& extension_id, |
660 const std::string& script) { | 660 const std::string& script) { |
661 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( | 661 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( |
662 profile(), extension_id, script); | 662 profile(), extension_id, script); |
663 } | 663 } |
OLD | NEW |