OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
6 #include "base/scoped_ptr.h" | 6 #include "base/scoped_ptr.h" |
7 #include "chrome/browser/autofill/autofill_infobar_delegate.h" | 7 #include "chrome/browser/autofill/autofill_infobar_delegate.h" |
8 #include "chrome/browser/autofill/autofill_manager.h" | 8 #include "chrome/browser/autofill/autofill_manager.h" |
9 #include "chrome/browser/tab_contents/infobar_delegate.h" | 9 #include "chrome/browser/tab_contents/infobar_delegate.h" |
10 #include "chrome/browser/tab_contents/navigation_controller.h" | 10 #include "chrome/browser/tab_contents/navigation_controller.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 TEST_F(AutoFillInfoBarDelegateTest, GetButtonLabel) { | 106 TEST_F(AutoFillInfoBarDelegateTest, GetButtonLabel) { |
107 std::wstring accept = l10n_util::GetString(IDS_AUTOFILL_INFOBAR_ACCEPT); | 107 std::wstring accept = l10n_util::GetString(IDS_AUTOFILL_INFOBAR_ACCEPT); |
108 EXPECT_EQ(accept, | 108 EXPECT_EQ(accept, |
109 infobar_->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK)); | 109 infobar_->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_OK)); |
110 | 110 |
111 std::wstring deny = l10n_util::GetString(IDS_AUTOFILL_INFOBAR_DENY); | 111 std::wstring deny = l10n_util::GetString(IDS_AUTOFILL_INFOBAR_DENY); |
112 EXPECT_EQ(deny, | 112 EXPECT_EQ(deny, |
113 infobar_->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_CANCEL)); | 113 infobar_->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_CANCEL)); |
114 | |
115 // NOTREACHED if neither BUTTON_OK or BUTTON_CANCEL are passed in. | |
116 ASSERT_DEBUG_DEATH( | |
117 infobar_->GetButtonLabel(ConfirmInfoBarDelegate::BUTTON_NONE), ""); | |
118 } | 114 } |
119 | 115 |
120 TEST_F(AutoFillInfoBarDelegateTest, Accept) { | 116 TEST_F(AutoFillInfoBarDelegateTest, Accept) { |
121 infobar_->Accept(); | 117 infobar_->Accept(); |
122 EXPECT_TRUE(autofill_manager_->responded()); | 118 EXPECT_TRUE(autofill_manager_->responded()); |
123 EXPECT_TRUE(autofill_manager_->accepted()); | 119 EXPECT_TRUE(autofill_manager_->accepted()); |
124 } | 120 } |
125 | 121 |
126 TEST_F(AutoFillInfoBarDelegateTest, Cancel) { | 122 TEST_F(AutoFillInfoBarDelegateTest, Cancel) { |
127 infobar_->Cancel(); | 123 infobar_->Cancel(); |
128 EXPECT_TRUE(autofill_manager_->responded()); | 124 EXPECT_TRUE(autofill_manager_->responded()); |
129 EXPECT_FALSE(autofill_manager_->accepted()); | 125 EXPECT_FALSE(autofill_manager_->accepted()); |
130 } | 126 } |
131 | 127 |
132 } // namespace | 128 } // namespace |
OLD | NEW |