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

Unified Diff: chrome/browser/extensions/app_notification_manager_unittest.cc

Issue 10694056: CPM Extension Uninstall Watching (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for cq Created 8 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: chrome/browser/extensions/app_notification_manager_unittest.cc
diff --git a/chrome/browser/extensions/app_notification_manager_unittest.cc b/chrome/browser/extensions/app_notification_manager_unittest.cc
index 4ee381cab2ab6fd4875ce881012563d1acd7017b..329e47f6cb7b437e309ab0ab1325d21db228b6c0 100644
--- a/chrome/browser/extensions/app_notification_manager_unittest.cc
+++ b/chrome/browser/extensions/app_notification_manager_unittest.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/extensions/app_notification_test_util.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/extension_test_util.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/notification_details.h"
@@ -17,6 +18,7 @@
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
+using extensions::Extension;
namespace util = app_notification_test_util;
@@ -99,8 +101,12 @@ TEST_F(AppNotificationManagerTest, Simple) {
// notifications and removes associated data when that happens.
TEST_F(AppNotificationManagerTest, ExtensionUninstall) {
// Add some items from two test extension ids.
- std::string id1 = extension_test_util::MakeId("id1");
- std::string id2 = extension_test_util::MakeId("id2");
+ scoped_refptr<Extension> extension1 =
+ extension_test_util::CreateExtensionWithID("id1");
+ scoped_refptr<Extension> extension2 =
+ extension_test_util::CreateExtensionWithID("id2");
+ std::string id1 = extension1->id();
+ std::string id2 = extension2->id();
AppNotificationList list1;
AppNotificationList list2;
util::AddNotifications(&list1, id1, 5, "foo1");
@@ -114,7 +120,7 @@ TEST_F(AppNotificationManagerTest, ExtensionUninstall) {
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
content::Source<Profile>(profile_.get()),
- content::Details<const std::string>(&id1));
+ content::Details<const Extension>(extension1.get()));
// The id1 items should be gone but the id2 items should still be there.
EXPECT_EQ(NULL, mgr_->GetLast(id1));
« no previous file with comments | « chrome/browser/extensions/app_notification_manager.cc ('k') | chrome/browser/extensions/app_shortcut_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698