| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser/ui/webui/extensions/extension_settings_browsertest.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_browsertest.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 base::FilePath crx_path = path; | 85 base::FilePath crx_path = path; |
| 86 DCHECK(crx_path.Extension() == FILE_PATH_LITERAL(".crx")); | 86 DCHECK(crx_path.Extension() == FILE_PATH_LITERAL(".crx")); |
| 87 if (crx_path.empty()) | 87 if (crx_path.empty()) |
| 88 return NULL; | 88 return NULL; |
| 89 | 89 |
| 90 scoped_refptr<extensions::CrxInstaller> installer( | 90 scoped_refptr<extensions::CrxInstaller> installer( |
| 91 extensions::CrxInstaller::Create(service, install_ui.Pass())); | 91 extensions::CrxInstaller::Create(service, install_ui.Pass())); |
| 92 installer->set_expected_id(std::string()); | 92 installer->set_expected_id(std::string()); |
| 93 installer->set_is_gallery_install(false); | 93 installer->set_is_gallery_install(false); |
| 94 installer->set_install_source(extensions::Manifest::INTERNAL); | 94 installer->set_install_source(extensions::Manifest::INTERNAL); |
| 95 installer->set_install_wait_for_idle(false); | 95 installer->set_install_immediately(true); |
| 96 installer->set_off_store_install_allow_reason( | 96 installer->set_off_store_install_allow_reason( |
| 97 extensions::CrxInstaller::OffStoreInstallAllowedInTest); | 97 extensions::CrxInstaller::OffStoreInstallAllowedInTest); |
| 98 | 98 |
| 99 observer_->Watch( | 99 observer_->Watch( |
| 100 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 100 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 101 content::Source<extensions::CrxInstaller>(installer.get())); | 101 content::Source<extensions::CrxInstaller>(installer.get())); |
| 102 | 102 |
| 103 installer->InstallCrx(crx_path); | 103 installer->InstallCrx(crx_path); |
| 104 | 104 |
| 105 observer_->Wait(); | 105 observer_->Wait(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 123 iter != errors->end(); ++iter) | 123 iter != errors->end(); ++iter) |
| 124 VLOG(1) << *iter; | 124 VLOG(1) << *iter; |
| 125 | 125 |
| 126 return NULL; | 126 return NULL; |
| 127 } | 127 } |
| 128 | 128 |
| 129 if (!observer_->WaitForExtensionViewsToLoad()) | 129 if (!observer_->WaitForExtensionViewsToLoad()) |
| 130 return NULL; | 130 return NULL; |
| 131 return service->GetExtensionById(last_loaded_extension_id(), false); | 131 return service->GetExtensionById(last_loaded_extension_id(), false); |
| 132 } | 132 } |
| OLD | NEW |