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

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

Issue 282103003: Moved IS_EPHEMERAL flag to extension prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix up file header Created 6 years, 7 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_unittest.h" 10 #include "chrome/browser/extensions/extension_service_unittest.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 ExtensionRegistry::ENABLED)) { 69 ExtensionRegistry::ENABLED)) {
70 return testing::AssertionFailure() << "Extension already installed."; 70 return testing::AssertionFailure() << "Extension already installed.";
71 } 71 }
72 72
73 // Notify the service that the extension is installed. This adds it to the 73 // Notify the service that the extension is installed. This adds it to the
74 // registry, notifies interested parties, etc. 74 // registry, notifies interested parties, etc.
75 service_->OnExtensionInstalled(extension, 75 service_->OnExtensionInstalled(extension,
76 syncer::StringOrdinal(), 76 syncer::StringOrdinal(),
77 false, // No requirement errors. 77 false, // No requirement errors.
78 NOT_BLACKLISTED, 78 NOT_BLACKLISTED,
79 false, // Not ephemeral.
79 false); // Don't wait for idle. 80 false); // Don't wait for idle.
80 81
81 // Verify that the extension is now installed. 82 // Verify that the extension is now installed.
82 if (!registry_->GetExtensionById(extension->id(), 83 if (!registry_->GetExtensionById(extension->id(),
83 ExtensionRegistry::ENABLED)) { 84 ExtensionRegistry::ENABLED)) {
84 return testing::AssertionFailure() << "Could not install extension."; 85 return testing::AssertionFailure() << "Could not install extension.";
85 } 86 }
86 87
87 return testing::AssertionSuccess(); 88 return testing::AssertionSuccess();
88 } 89 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 CreateExtensionImportingModule(shared_module->id(), whitelisted_id); 173 CreateExtensionImportingModule(shared_module->id(), whitelisted_id);
173 EXPECT_TRUE(InstallExtension(whitelisted_extension)); 174 EXPECT_TRUE(InstallExtension(whitelisted_extension));
174 175
175 // Try to install an extension with an ID that is not whitelisted. 176 // Try to install an extension with an ID that is not whitelisted.
176 scoped_refptr<Extension> nonwhitelisted_extension = 177 scoped_refptr<Extension> nonwhitelisted_extension =
177 CreateExtensionImportingModule(shared_module->id(), nonwhitelisted_id); 178 CreateExtensionImportingModule(shared_module->id(), nonwhitelisted_id);
178 EXPECT_FALSE(InstallExtension(nonwhitelisted_extension)); 179 EXPECT_FALSE(InstallExtension(nonwhitelisted_extension));
179 } 180 }
180 181
181 } // namespace extensions 182 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_util.cc ('k') | chrome/browser/extensions/test_extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698