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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm

Issue 964563002: Replace SetAuthenticatedUsername with SetAuthenticatedAccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@priv
Patch Set: rebased Created 5 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 TEST_F(BookmarkBubbleControllerTest, SyncPromoNotSignedIn) { 461 TEST_F(BookmarkBubbleControllerTest, SyncPromoNotSignedIn) {
462 const BookmarkNode* node = CreateTestBookmark(); 462 const BookmarkNode* node = CreateTestBookmark();
463 BookmarkBubbleController* controller = ControllerForNode(node); 463 BookmarkBubbleController* controller = ControllerForNode(node);
464 464
465 EXPECT_EQ(1u, [[controller.syncPromoPlaceholder subviews] count]); 465 EXPECT_EQ(1u, [[controller.syncPromoPlaceholder subviews] count]);
466 } 466 }
467 467
468 // Confirm that the sync promo is not displayed when the user is signed in. 468 // Confirm that the sync promo is not displayed when the user is signed in.
469 TEST_F(BookmarkBubbleControllerTest, SyncPromoSignedIn) { 469 TEST_F(BookmarkBubbleControllerTest, SyncPromoSignedIn) {
470 SigninManager* signin = SigninManagerFactory::GetForProfile(profile()); 470 SigninManager* signin = SigninManagerFactory::GetForProfile(profile());
471 signin->SetAuthenticatedUsername("fake_username"); 471 signin->SetAuthenticatedAccountInfo("fake_username", "fake_username");
472 472
473 const BookmarkNode* node = CreateTestBookmark(); 473 const BookmarkNode* node = CreateTestBookmark();
474 BookmarkBubbleController* controller = ControllerForNode(node); 474 BookmarkBubbleController* controller = ControllerForNode(node);
475 475
476 EXPECT_EQ(0u, [[controller.syncPromoPlaceholder subviews] count]); 476 EXPECT_EQ(0u, [[controller.syncPromoPlaceholder subviews] count]);
477 } 477 }
478 478
479 } // namespace 479 } // namespace
480 480
481 @implementation NSApplication (BookmarkBubbleUnitTest) 481 @implementation NSApplication (BookmarkBubbleUnitTest)
482 // Add handler for the editBookmarkNode: action to NSApp for testing purposes. 482 // Add handler for the editBookmarkNode: action to NSApp for testing purposes.
483 // Normally this would be sent up the responder tree correctly, but since 483 // Normally this would be sent up the responder tree correctly, but since
484 // tests run in the background, key window and main window are never set on 484 // tests run in the background, key window and main window are never set on
485 // NSApplication. Adding it to NSApplication directly removes the need for 485 // NSApplication. Adding it to NSApplication directly removes the need for
486 // worrying about what the current window with focus is. 486 // worrying about what the current window with focus is.
487 - (void)editBookmarkNode:(id)sender { 487 - (void)editBookmarkNode:(id)sender {
488 EXPECT_TRUE([sender respondsToSelector:@selector(node)]); 488 EXPECT_TRUE([sender respondsToSelector:@selector(node)]);
489 BookmarkBubbleControllerTest::edits_++; 489 BookmarkBubbleControllerTest::edits_++;
490 } 490 }
491 491
492 @end 492 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698