OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |