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/download/download_test_observer.h" | 8 #include "chrome/browser/download/download_test_observer.h" |
9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 scoped_ptr<base::DictionaryValue>(parsed_manifest)); | 100 scoped_ptr<base::DictionaryValue>(parsed_manifest)); |
101 } | 101 } |
102 | 102 |
103 scoped_refptr<CrxInstaller> installer( | 103 scoped_refptr<CrxInstaller> installer( |
104 CrxInstaller::Create(service, | 104 CrxInstaller::Create(service, |
105 mock_install_prompt, /* ownership transferred */ | 105 mock_install_prompt, /* ownership transferred */ |
106 approval.get() /* keep ownership */)); | 106 approval.get() /* keep ownership */)); |
107 installer->set_allow_silent_install(true); | 107 installer->set_allow_silent_install(true); |
108 installer->set_is_gallery_install(true); | 108 installer->set_is_gallery_install(true); |
109 installer->InstallCrx(PackExtension(ext_path)); | 109 installer->InstallCrx(PackExtension(ext_path)); |
110 ui_test_utils::RunMessageLoop(); | 110 content::RunMessageLoop(); |
111 | 111 |
112 EXPECT_TRUE(mock_install_prompt->did_succeed()); | 112 EXPECT_TRUE(mock_install_prompt->did_succeed()); |
113 return installer; | 113 return installer; |
114 } | 114 } |
115 | 115 |
116 // Installs an extension and checks that it has scopes granted IFF | 116 // Installs an extension and checks that it has scopes granted IFF |
117 // |record_oauth2_grant| is true. | 117 // |record_oauth2_grant| is true. |
118 void CheckHasEmptyScopesAfterInstall(const std::string& ext_relpath, | 118 void CheckHasEmptyScopesAfterInstall(const std::string& ext_relpath, |
119 bool record_oauth2_grant) { | 119 bool record_oauth2_grant) { |
120 CommandLine::ForCurrentProcess()->AppendSwitch( | 120 CommandLine::ForCurrentProcess()->AppendSwitch( |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 EXPECT_EQ(string16(), mock_prompt->error()) << kTestData[i]; | 268 EXPECT_EQ(string16(), mock_prompt->error()) << kTestData[i]; |
269 } else { | 269 } else { |
270 EXPECT_EQ(l10n_util::GetStringUTF16( | 270 EXPECT_EQ(l10n_util::GetStringUTF16( |
271 IDS_EXTENSION_INSTALL_DISALLOWED_ON_SITE), | 271 IDS_EXTENSION_INSTALL_DISALLOWED_ON_SITE), |
272 mock_prompt->error()) << kTestData[i]; | 272 mock_prompt->error()) << kTestData[i]; |
273 } | 273 } |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 } // namespace extensions | 277 } // namespace extensions |
OLD | NEW |