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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
461 extensions::CrxInstaller::Create(service, install_ui.Pass())); | 461 extensions::CrxInstaller::Create(service, install_ui.Pass())); |
462 installer->set_expected_id(id); | 462 installer->set_expected_id(id); |
463 installer->set_creation_flags(creation_flags); | 463 installer->set_creation_flags(creation_flags); |
464 installer->set_install_source(install_source); | 464 installer->set_install_source(install_source); |
465 installer->set_install_wait_for_idle(wait_for_idle); | 465 installer->set_install_wait_for_idle(wait_for_idle); |
466 if (!installer->is_gallery_install()) { | 466 if (!installer->is_gallery_install()) { |
467 installer->set_off_store_install_allow_reason( | 467 installer->set_off_store_install_allow_reason( |
468 extensions::CrxInstaller::OffStoreInstallAllowedInTest); | 468 extensions::CrxInstaller::OffStoreInstallAllowedInTest); |
469 } | 469 } |
470 | 470 |
471 // TODO(tmdiep): remove this hack | |
tmdiep
2014/05/15 02:18:42
TODO in this patch before committing.
| |
472 installer->set_is_ephemeral(creation_flags & Extension::IS_EPHEMERAL); | |
473 | |
471 observer_->Watch( | 474 observer_->Watch( |
472 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 475 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
473 content::Source<extensions::CrxInstaller>(installer.get())); | 476 content::Source<extensions::CrxInstaller>(installer.get())); |
474 | 477 |
475 installer->InstallCrx(crx_path); | 478 installer->InstallCrx(crx_path); |
476 | 479 |
477 observer_->Wait(); | 480 observer_->Wait(); |
478 } | 481 } |
479 | 482 |
480 size_t num_after = service->extensions()->size(); | 483 size_t num_after = service->extensions()->size(); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
616 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( | 619 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( |
617 profile(), extension_id, script); | 620 profile(), extension_id, script); |
618 } | 621 } |
619 | 622 |
620 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( | 623 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( |
621 const std::string& extension_id, | 624 const std::string& extension_id, |
622 const std::string& script) { | 625 const std::string& script) { |
623 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( | 626 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( |
624 profile(), extension_id, script); | 627 profile(), extension_id, script); |
625 } | 628 } |
OLD | NEW |