| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( | 75 const Extension* ExtensionBrowserTest::LoadExtensionWithFlags( |
| 76 const FilePath& path, int flags) { | 76 const FilePath& path, int flags) { |
| 77 ExtensionService* service = browser()->profile()->GetExtensionService(); | 77 ExtensionService* service = browser()->profile()->GetExtensionService(); |
| 78 { | 78 { |
| 79 content::NotificationRegistrar registrar; | 79 content::NotificationRegistrar registrar; |
| 80 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 80 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 81 content::NotificationService::AllSources()); | 81 content::NotificationService::AllSources()); |
| 82 scoped_refptr<extensions::UnpackedInstaller> installer( | 82 scoped_refptr<extensions::UnpackedInstaller> installer( |
| 83 extensions::UnpackedInstaller::Create(service)); | 83 extensions::UnpackedInstaller::Create(service)); |
| 84 installer->set_prompt_for_plugins(false); | 84 installer->set_prompt_for_plugins(false); |
| 85 installer->set_require_modern_manifest_version( |
| 86 (flags & kFlagAllowOldManifestVersions) == 0); |
| 85 installer->Load(path); | 87 installer->Load(path); |
| 86 content::RunMessageLoop(); | 88 content::RunMessageLoop(); |
| 87 } | 89 } |
| 88 | 90 |
| 89 // Find the loaded extension by its path. See crbug.com/59531 for why | 91 // Find the loaded extension by its path. See crbug.com/59531 for why |
| 90 // we cannot just use last_loaded_extension_id_. | 92 // we cannot just use last_loaded_extension_id_. |
| 91 FilePath extension_path = path; | 93 FilePath extension_path = path; |
| 92 file_util::AbsolutePath(&extension_path); | 94 file_util::AbsolutePath(&extension_path); |
| 93 const Extension* extension = NULL; | 95 const Extension* extension = NULL; |
| 94 for (ExtensionSet::const_iterator iter = service->extensions()->begin(); | 96 for (ExtensionSet::const_iterator iter = service->extensions()->begin(); |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 case content::NOTIFICATION_LOAD_STOP: | 675 case content::NOTIFICATION_LOAD_STOP: |
| 674 VLOG(1) << "Got LOAD_STOP notification."; | 676 VLOG(1) << "Got LOAD_STOP notification."; |
| 675 MessageLoopForUI::current()->Quit(); | 677 MessageLoopForUI::current()->Quit(); |
| 676 break; | 678 break; |
| 677 | 679 |
| 678 default: | 680 default: |
| 679 NOTREACHED(); | 681 NOTREACHED(); |
| 680 break; | 682 break; |
| 681 } | 683 } |
| 682 } | 684 } |
| OLD | NEW |