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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_main_container_unittest.mm

Issue 58913002: [rAc OSX] Ensure that the "Save in Chrome?" tooltip is only visible when the checkbox is. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/ui/cocoa/autofill/autofill_main_container.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/ui/cocoa/autofill/autofill_main_container.h" 5 #import "chrome/browser/ui/cocoa/autofill/autofill_main_container.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h" 8 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h"
9 #import "chrome/browser/ui/cocoa/autofill/autofill_section_view.h" 9 #import "chrome/browser/ui/cocoa/autofill/autofill_section_view.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 TEST_F(AutofillMainContainerTest, SaveInChromeCheckboxVisibility) { 104 TEST_F(AutofillMainContainerTest, SaveInChromeCheckboxVisibility) {
105 using namespace testing; 105 using namespace testing;
106 106
107 // Tests that the checkbox is only visible if the delegate allows it. 107 // Tests that the checkbox is only visible if the delegate allows it.
108 EXPECT_CALL(delegate_, ShouldOfferToSaveInChrome()).Times(2) 108 EXPECT_CALL(delegate_, ShouldOfferToSaveInChrome()).Times(2)
109 .WillOnce(Return(false)) 109 .WillOnce(Return(false))
110 .WillOnce(Return(true)); 110 .WillOnce(Return(true));
111 111
112 RebuildView(); 112 RebuildView();
113 NSButton* checkbox = [container_ saveInChromeCheckboxForTesting]; 113 NSButton* checkbox = [container_ saveInChromeCheckboxForTesting];
114 NSImageView* tooltip = [container_ saveInChromeTooltipForTesting];
114 ASSERT_TRUE(checkbox); 115 ASSERT_TRUE(checkbox);
116 ASSERT_TRUE(tooltip);
115 117
116 EXPECT_TRUE([checkbox isHidden]); 118 EXPECT_TRUE([checkbox isHidden]);
119 EXPECT_TRUE([tooltip isHidden]);
117 [container_ modelChanged]; 120 [container_ modelChanged];
118 EXPECT_FALSE([checkbox isHidden]); 121 EXPECT_FALSE([checkbox isHidden]);
122 EXPECT_FALSE([tooltip isHidden]);
119 } 123 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/autofill/autofill_main_container.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698