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_unittest.h" | 10 #include "chrome/browser/extensions/extension_service_unittest.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |