Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/extensions/shared_module_service_unittest.cc

Issue 573113002: Relax shared module whitelist restriction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/shared_module_service.cc ('k') | chrome/common/pepper_permission_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698