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_path.h" | 10 #include "base/file_path.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 FilePath crx_path = path; | 296 FilePath crx_path = path; |
297 if (crx_path.Extension() != FILE_PATH_LITERAL(".crx")) { | 297 if (crx_path.Extension() != FILE_PATH_LITERAL(".crx")) { |
298 crx_path = PackExtension(path); | 298 crx_path = PackExtension(path); |
299 } | 299 } |
300 if (crx_path.empty()) | 300 if (crx_path.empty()) |
301 return NULL; | 301 return NULL; |
302 | 302 |
303 scoped_refptr<CrxInstaller> installer( | 303 scoped_refptr<CrxInstaller> installer( |
304 CrxInstaller::Create(service, install_ui)); | 304 CrxInstaller::Create(service, install_ui)); |
305 installer->set_expected_id(id); | 305 installer->set_expected_id(id); |
306 installer->set_allow_off_store_install(true); | |
307 installer->set_is_gallery_install(from_webstore); | 306 installer->set_is_gallery_install(from_webstore); |
| 307 if (!from_webstore) { |
| 308 installer->set_off_store_install_allow_reason( |
| 309 CrxInstaller::OffStoreInstallAllowedInTest); |
| 310 } |
308 | 311 |
309 content::NotificationRegistrar registrar; | 312 content::NotificationRegistrar registrar; |
310 registrar.Add(this, chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 313 registrar.Add(this, chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
311 content::Source<CrxInstaller>(installer.get())); | 314 content::Source<CrxInstaller>(installer.get())); |
312 | 315 |
313 installer->InstallCrx(crx_path); | 316 installer->InstallCrx(crx_path); |
314 | 317 |
315 ui_test_utils::RunMessageLoop(); | 318 ui_test_utils::RunMessageLoop(); |
316 } | 319 } |
317 | 320 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 case content::NOTIFICATION_LOAD_STOP: | 591 case content::NOTIFICATION_LOAD_STOP: |
589 VLOG(1) << "Got LOAD_STOP notification."; | 592 VLOG(1) << "Got LOAD_STOP notification."; |
590 MessageLoopForUI::current()->Quit(); | 593 MessageLoopForUI::current()->Quit(); |
591 break; | 594 break; |
592 | 595 |
593 default: | 596 default: |
594 NOTREACHED(); | 597 NOTREACHED(); |
595 break; | 598 break; |
596 } | 599 } |
597 } | 600 } |
OLD | NEW |