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

Unified Diff: extensions/browser/image_loader_unittest.cc

Issue 355223002: Add ExtensionsTestBrowserContext class for test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make as member Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/image_loader_unittest.cc
diff --git a/extensions/browser/image_loader_unittest.cc b/extensions/browser/image_loader_unittest.cc
index 68b93b0f841640c63ffdfda73a6b7d9b1b90291e..73d173dc4ef23732d27c24ac00c3688e335e07ba 100644
--- a/extensions/browser/image_loader_unittest.cc
+++ b/extensions/browser/image_loader_unittest.cc
@@ -9,12 +9,12 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
-#include "content/public/browser/notification_service.h"
#include "content/public/test/test_browser_thread.h"
#include "extensions/browser/component_extension_resource_manager.h"
+#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extensions_browser_client.h"
+#include "extensions/browser/extensions_test_browser_context.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h"
@@ -185,13 +185,10 @@ TEST_F(ImageLoaderTest, DeleteExtensionWhileWaitingForCache) {
// The image isn't cached, so we should not have received notification.
EXPECT_EQ(0, image_loaded_count());
+ extensions::ExtensionsTestBrowserContext browser_context;
// Send out notification the extension was uninstalled.
- UnloadedExtensionInfo details(extension.get(),
- UnloadedExtensionInfo::REASON_UNINSTALL);
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
- content::NotificationService::AllSources(),
- content::Details<UnloadedExtensionInfo>(&details));
+ extensions::ExtensionRegistry::Get(&browser_context)->TriggerOnUnloaded(
+ extension.get(), UnloadedExtensionInfo::REASON_UNINSTALL);
// Chuck the extension, that way if anyone tries to access it we should crash
// or get valgrind errors.

Powered by Google App Engine
This is Rietveld 408576698