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

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: Created 8 years, 6 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 cd4fc7907400619f0d7ae0745e4e05dfc19a744a..5790661300333be3379cca37e45ffebfa43d3835 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;
@@ -105,8 +107,12 @@ TEST_F(AppNotificationManagerTest, Simple) {
#endif
TEST_F(AppNotificationManagerTest, MAYBE_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::CreateExtension(
+ "pdedgpfalcphpbgbdknbecnlmobnceia");
Yoyo Zhou 2012/07/09 17:06:37 nit: I would expect "id1" to still work here. But
Devlin 2012/07/09 20:48:26 Done.
+ scoped_refptr<Extension> extension2 = extension_test_util::CreateExtension(
+ "lefjkpnnldkajgcboocjlhildjgiofgg");
+ std::string id1 = extension1->id();
+ std::string id2 = extension2->id();
AppNotificationList list1;
AppNotificationList list2;
util::AddNotifications(&list1, id1, 5, "foo1");
@@ -120,7 +126,7 @@ TEST_F(AppNotificationManagerTest, MAYBE_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));

Powered by Google App Engine
This is Rietveld 408576698