| 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 "chrome/browser/extensions/extension_error_controller.h" | 6 #include "chrome/browser/extensions/extension_error_controller.h" |
| 7 #include "chrome/browser/extensions/extension_error_ui.h" | 7 #include "chrome/browser/extensions/extension_error_ui.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_service_test_base.h" | 9 #include "chrome/browser/extensions/extension_service_test_base.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // We don't want a first-run ExtensionService, since we ignore warnings | 123 // We don't want a first-run ExtensionService, since we ignore warnings |
| 124 // for new profiles. | 124 // for new profiles. |
| 125 ExtensionServiceInitParams params = CreateDefaultInitParams(); | 125 ExtensionServiceInitParams params = CreateDefaultInitParams(); |
| 126 params.is_first_run = false; | 126 params.is_first_run = false; |
| 127 InitializeExtensionService(params); | 127 InitializeExtensionService(params); |
| 128 } | 128 } |
| 129 | 129 |
| 130 testing::AssertionResult | 130 testing::AssertionResult |
| 131 ExtensionErrorControllerUnitTest::AddBlacklistedExtension( | 131 ExtensionErrorControllerUnitTest::AddBlacklistedExtension( |
| 132 const Extension* extension) { | 132 const Extension* extension) { |
| 133 GetPrefs()->SetExtensionBlacklisted(extension->id(), true); | 133 GetPrefs()->SetExtensionBlacklistState(extension->id(), |
| 134 BLACKLISTED_MALWARE); |
| 134 service_->AddExtension(extension); | 135 service_->AddExtension(extension); |
| 135 | 136 |
| 136 // Make sure the extension is added to the blacklisted set. | 137 // Make sure the extension is added to the blacklisted set. |
| 137 if (!ExtensionRegistry::Get(profile())->blacklisted_extensions() | 138 if (!ExtensionRegistry::Get(profile())->blacklisted_extensions() |
| 138 .Contains(extension->id())) { | 139 .Contains(extension->id())) { |
| 139 return testing::AssertionFailure() | 140 return testing::AssertionFailure() |
| 140 << "Failed to add blacklisted extension."; | 141 << "Failed to add blacklisted extension."; |
| 141 } | 142 } |
| 142 | 143 |
| 143 return testing::AssertionSuccess(); | 144 return testing::AssertionSuccess(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 GetPrefs()->AcknowledgeBlacklistedExtension(extension->id()); | 206 GetPrefs()->AcknowledgeBlacklistedExtension(extension->id()); |
| 206 | 207 |
| 207 service_->Init(); | 208 service_->Init(); |
| 208 | 209 |
| 209 // We should never have made an alert, because the extension should already | 210 // We should never have made an alert, because the extension should already |
| 210 // be acknowledged. | 211 // be acknowledged. |
| 211 ASSERT_FALSE(g_error_ui); | 212 ASSERT_FALSE(g_error_ui); |
| 212 } | 213 } |
| 213 | 214 |
| 214 } // namespace extensions | 215 } // namespace extensions |
| OLD | NEW |