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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm

Issue 1302243002: [Mac] Remove kPulseBookmarkButtonNotification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarkeditor
Patch Set: Fix test. Created 5 years, 4 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/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm
index 758835ac57718f868e983fffbc9e5e4b3c4f54a3..a807effddb44453747fd905d6aee0436a8cc192f 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm
@@ -31,41 +31,6 @@ using bookmarks::BookmarkModel;
using bookmarks::BookmarkNode;
using content::WebContents;
-// Watch for bookmark pulse notifications so we can confirm they were sent.
-@interface BookmarkPulseObserver : NSObject {
- int notifications_;
-}
-@property (assign, nonatomic) int notifications;
-@end
-
-
-@implementation BookmarkPulseObserver
-
-@synthesize notifications = notifications_;
-
-- (id)init {
- if ((self = [super init])) {
- [[NSNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(pulseBookmarkNotification:)
- name:bookmark_button::kPulseBookmarkButtonNotification
- object:nil];
- }
- return self;
-}
-
-- (void)pulseBookmarkNotification:(NSNotificationCenter *)notification {
- notifications_++;
-}
-
-- (void)dealloc {
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- [super dealloc];
-}
-
-@end
-
-
namespace {
// URL of the test bookmark.
@@ -242,7 +207,6 @@ TEST_F(BookmarkBubbleControllerTest, TestFolderWithBlankName) {
EXPECT_TRUE(blankFolderFound);
}
-
// Click on edit; bubble gets closed.
TEST_F(BookmarkBubbleControllerTest, TestEdit) {
const BookmarkNode* node = CreateTestBookmark();
@@ -262,17 +226,14 @@ TEST_F(BookmarkBubbleControllerTest, TestClose) {
const BookmarkNode* node = CreateTestBookmark();
EXPECT_EQ(edits_, 0);
- base::scoped_nsobject<BookmarkPulseObserver> observer(
- [[BookmarkPulseObserver alloc] init]);
- EXPECT_EQ([observer notifications], 0);
BookmarkBubbleController* controller = ControllerForNode(node);
+ EXPECT_EQ(node, controller.pulsingBookmarkNode);
EXPECT_TRUE(controller);
EXPECT_FALSE(IsWindowClosing());
- EXPECT_EQ([observer notifications], 1);
[controller ok:controller];
EXPECT_EQ(edits_, 0);
EXPECT_TRUE(IsWindowClosing());
- EXPECT_EQ([observer notifications], 2);
+ EXPECT_EQ(nullptr, controller.pulsingBookmarkNode);
}
// User changes title and parent folder in the UI

Powered by Google App Engine
This is Rietveld 408576698