OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_service_test_base.h" | 10 #include "chrome/browser/extensions/extension_service_test_base.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 CreateExtensionImportingModule(shared_module->id(), | 261 CreateExtensionImportingModule(shared_module->id(), |
262 whitelisted_id, | 262 whitelisted_id, |
263 "1.0"); | 263 "1.0"); |
264 EXPECT_TRUE(InstallExtension(whitelisted_extension.get(), false)); | 264 EXPECT_TRUE(InstallExtension(whitelisted_extension.get(), false)); |
265 | 265 |
266 // Try to install an extension with an ID that is not whitelisted. | 266 // Try to install an extension with an ID that is not whitelisted. |
267 scoped_refptr<Extension> nonwhitelisted_extension = | 267 scoped_refptr<Extension> nonwhitelisted_extension = |
268 CreateExtensionImportingModule(shared_module->id(), | 268 CreateExtensionImportingModule(shared_module->id(), |
269 nonwhitelisted_id, | 269 nonwhitelisted_id, |
270 "1.0"); | 270 "1.0"); |
271 EXPECT_FALSE(InstallExtension(nonwhitelisted_extension.get(), false)); | 271 // This should succeed because only CRX installer (and by extension the |
| 272 // WebStore Installer) checks the shared module whitelist. InstallExtension |
| 273 // bypasses the whitelist check because the SharedModuleService does not |
| 274 // care about whitelists. |
| 275 EXPECT_TRUE(InstallExtension(nonwhitelisted_extension.get(), false)); |
272 } | 276 } |
273 | 277 |
274 } // namespace extensions | 278 } // namespace extensions |
OLD | NEW |