| 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/download/download_crx_util.h" | 5 #include "chrome/browser/download/download_crx_util.h" |
| 6 #include "chrome/browser/download/download_service.h" | 6 #include "chrome/browser/download/download_service.h" |
| 7 #include "chrome/browser/download/download_service_factory.h" | 7 #include "chrome/browser/download/download_service_factory.h" |
| 8 #include "chrome/browser/extensions/crx_installer.h" | 8 #include "chrome/browser/extensions/crx_installer.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 id, | 101 id, |
| 102 scoped_ptr<base::DictionaryValue>(parsed_manifest)); | 102 scoped_ptr<base::DictionaryValue>(parsed_manifest)); |
| 103 } | 103 } |
| 104 | 104 |
| 105 scoped_refptr<CrxInstaller> installer( | 105 scoped_refptr<CrxInstaller> installer( |
| 106 CrxInstaller::Create(service, | 106 CrxInstaller::Create(service, |
| 107 mock_install_prompt, /* ownership transferred */ | 107 mock_install_prompt, /* ownership transferred */ |
| 108 approval.get() /* keep ownership */)); | 108 approval.get() /* keep ownership */)); |
| 109 installer->set_allow_silent_install(true); | 109 installer->set_allow_silent_install(true); |
| 110 installer->set_is_gallery_install(true); | 110 installer->set_is_gallery_install(true); |
| 111 installer->set_bypass_blacklist_for_test(true); |
| 111 installer->InstallCrx(PackExtension(ext_path)); | 112 installer->InstallCrx(PackExtension(ext_path)); |
| 112 content::RunMessageLoop(); | 113 content::RunMessageLoop(); |
| 113 | 114 |
| 114 EXPECT_TRUE(mock_install_prompt->did_succeed()); | 115 EXPECT_TRUE(mock_install_prompt->did_succeed()); |
| 115 return installer; | 116 return installer; |
| 116 } | 117 } |
| 117 | 118 |
| 118 // Installs an extension and checks that it has scopes granted IFF | 119 // Installs an extension and checks that it has scopes granted IFF |
| 119 // |record_oauth2_grant| is true. | 120 // |record_oauth2_grant| is true. |
| 120 void CheckHasEmptyScopesAfterInstall(const std::string& ext_relpath, | 121 void CheckHasEmptyScopesAfterInstall(const std::string& ext_relpath, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 EXPECT_EQ(string16(), mock_prompt->error()) << kTestData[i]; | 279 EXPECT_EQ(string16(), mock_prompt->error()) << kTestData[i]; |
| 279 } else { | 280 } else { |
| 280 EXPECT_EQ(l10n_util::GetStringUTF16( | 281 EXPECT_EQ(l10n_util::GetStringUTF16( |
| 281 IDS_EXTENSION_INSTALL_DISALLOWED_ON_SITE), | 282 IDS_EXTENSION_INSTALL_DISALLOWED_ON_SITE), |
| 282 mock_prompt->error()) << kTestData[i]; | 283 mock_prompt->error()) << kTestData[i]; |
| 283 } | 284 } |
| 284 } | 285 } |
| 285 } | 286 } |
| 286 | 287 |
| 287 } // namespace extensions | 288 } // namespace extensions |
| OLD | NEW |