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

Side by Side Diff: chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm

Issue 245035: Bookmark menus not updated when their name is edited in the bookmark bar.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/bookmark_menu_bridge.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #import <AppKit/AppKit.h> 5 #import <AppKit/AppKit.h>
6 #import "base/scoped_nsobject.h" 6 #import "base/scoped_nsobject.h"
7 #include "chrome/app/chrome_dll_resource.h" 7 #include "chrome/app/chrome_dll_resource.h"
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/cocoa/bookmark_menu_bridge.h" 9 #include "chrome/browser/cocoa/bookmark_menu_bridge.h"
10 #include "chrome/browser/cocoa/browser_test_helper.h" 10 #include "chrome/browser/cocoa/browser_test_helper.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 const BookmarkNode* node = 225 const BookmarkNode* node =
226 model->AddURL(root, 0, ASCIIToWide("Test Item"), 226 model->AddURL(root, 0, ASCIIToWide("Test Item"),
227 GURL("http://favicon-test")); 227 GURL("http://favicon-test"));
228 NSMenuItem* item = [menu itemWithTitle:@"Test Item"]; 228 NSMenuItem* item = [menu itemWithTitle:@"Test Item"];
229 EXPECT_TRUE([item image]); 229 EXPECT_TRUE([item image]);
230 [item setImage:nil]; 230 [item setImage:nil];
231 bridge_->BookmarkNodeFavIconLoaded(model, node); 231 bridge_->BookmarkNodeFavIconLoaded(model, node);
232 EXPECT_TRUE([item image]); 232 EXPECT_TRUE([item image]);
233 } 233 }
234
235 TEST_F(BookmarkMenuBridgeTest, TestChangeTitle) {
236 NSMenu* menu = bridge_->menu_;
237 BookmarkModel* model = bridge_->GetBookmarkModel();
238 const BookmarkNode* root = model->GetBookmarkBarNode();
239 EXPECT_TRUE(model && root);
240
241 const BookmarkNode* node =
242 model->AddURL(root, 0, L"Test Item",
243 GURL("http://title-test"));
244 NSMenuItem* item = [menu itemWithTitle:@"Test Item"];
245 EXPECT_TRUE([item image]);
246
247 model->SetTitle(node, L"New Title");
248
249 item = [menu itemWithTitle:@"Test Item"];
250 EXPECT_FALSE(item);
251 item = [menu itemWithTitle:@"New Title"];
252 EXPECT_TRUE(item);
253 }
254
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_menu_bridge.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698