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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/passwords_bubble_controller_unittest.mm

Issue 1645503002: Remove dangling ManagePasswordsBubbleModel pointers. Test that different password bubbles don't pin… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.h" 5 #include "chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 [base::mac::ObjCCast<InfoBubbleWindow>([controller() window]) retain]); 63 [base::mac::ObjCCast<InfoBubbleWindow>([controller() window]) retain]);
64 [window setAllowedAnimations:info_bubble::kAnimateNone]; 64 [window setAllowedAnimations:info_bubble::kAnimateNone];
65 65
66 EXPECT_TRUE([window isVisible]); 66 EXPECT_TRUE([window isVisible]);
67 [controller() viewShouldDismiss]; 67 [controller() viewShouldDismiss];
68 EXPECT_FALSE([window isVisible]); 68 EXPECT_FALSE([window isVisible]);
69 } 69 }
70 70
71 TEST_F(ManagePasswordsBubbleControllerTest, ManageStateShouldHaveManageView) { 71 TEST_F(ManagePasswordsBubbleControllerTest, ManageStateShouldHaveManageView) {
72 SetUpManageState(); 72 SetUpManageState();
73 EXPECT_EQ([ManagePasswordsBubbleManageViewController class], 73 EXPECT_EQ([ManagePasswordsViewController class],
74 [[controller() currentController] class]); 74 [[controller() currentController] class]);
75 } 75 }
76 76
77 TEST_F(ManagePasswordsBubbleControllerTest, 77 TEST_F(ManagePasswordsBubbleControllerTest,
78 PendingStateShouldHaveUpdatePendingView) { 78 PendingStateShouldHaveUpdatePendingView) {
79 SetUpUpdatePendingState(false); 79 SetUpUpdatePendingState(false);
80 EXPECT_EQ([UpdatePendingPasswordViewController class], 80 EXPECT_EQ([UpdatePendingPasswordViewController class],
81 [[controller() currentController] class]); 81 [[controller() currentController] class]);
82 } 82 }
83 83
84 TEST_F(ManagePasswordsBubbleControllerTest, ClearModelOnClose) { 84 TEST_F(ManagePasswordsBubbleControllerTest, ClearModelOnClose) {
85 SetUpUpdatePendingState(false); 85 SetUpUpdatePendingState(false);
86 EXPECT_TRUE(controller().model); 86 EXPECT_TRUE(controller().model);
87 [controller() close]; 87 [controller() close];
88 EXPECT_FALSE(controller().model); 88 EXPECT_FALSE(controller().model);
89 } 89 }
90 90
91 } // namespace 91 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698