| OLD | NEW |
| 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 #include <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2132 | 2132 |
| 2133 controller()->EditClickedForSection(SECTION_EMAIL); | 2133 controller()->EditClickedForSection(SECTION_EMAIL); |
| 2134 EXPECT_TRUE(controller()->ShouldOfferToSaveInChrome()); | 2134 EXPECT_TRUE(controller()->ShouldOfferToSaveInChrome()); |
| 2135 | 2135 |
| 2136 controller()->MenuModelForSection(SECTION_EMAIL)->ActivatedAt(0); | 2136 controller()->MenuModelForSection(SECTION_EMAIL)->ActivatedAt(0); |
| 2137 EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome()); | 2137 EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome()); |
| 2138 | 2138 |
| 2139 controller()->MenuModelForSection(SECTION_EMAIL)->ActivatedAt(1); | 2139 controller()->MenuModelForSection(SECTION_EMAIL)->ActivatedAt(1); |
| 2140 EXPECT_TRUE(controller()->ShouldOfferToSaveInChrome()); | 2140 EXPECT_TRUE(controller()->ShouldOfferToSaveInChrome()); |
| 2141 | 2141 |
| 2142 profile()->set_incognito(true); | 2142 profile()->ForceIncognito(true); |
| 2143 EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome()); | 2143 EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome()); |
| 2144 } | 2144 } |
| 2145 | 2145 |
| 2146 // Tests that user is prompted when using instrument with minimal address. | 2146 // Tests that user is prompted when using instrument with minimal address. |
| 2147 TEST_F(AutofillDialogControllerTest, UpgradeMinimalAddress) { | 2147 TEST_F(AutofillDialogControllerTest, UpgradeMinimalAddress) { |
| 2148 // A minimal address being selected should trigger error validation in the | 2148 // A minimal address being selected should trigger error validation in the |
| 2149 // view. Called once for each incomplete suggestion. | 2149 // view. Called once for each incomplete suggestion. |
| 2150 EXPECT_CALL(*controller()->GetView(), UpdateForErrors()).Times(1); | 2150 EXPECT_CALL(*controller()->GetView(), UpdateForErrors()).Times(1); |
| 2151 | 2151 |
| 2152 scoped_ptr<wallet::WalletItems> wallet_items = wallet::GetTestWalletItems(); | 2152 scoped_ptr<wallet::WalletItems> wallet_items = wallet::GetTestWalletItems(); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2534 SubmitWithWalletItems(CompleteAndValidWalletItems()); | 2534 SubmitWithWalletItems(CompleteAndValidWalletItems()); |
| 2535 controller()->set_dialog_type(DIALOG_TYPE_AUTOCHECKOUT); | 2535 controller()->set_dialog_type(DIALOG_TYPE_AUTOCHECKOUT); |
| 2536 controller()->OnDidGetFullWallet(wallet::GetTestFullWallet()); | 2536 controller()->OnDidGetFullWallet(wallet::GetTestFullWallet()); |
| 2537 controller()->OnAutocheckoutError(); | 2537 controller()->OnAutocheckoutError(); |
| 2538 controller()->ViewClosed(); | 2538 controller()->ViewClosed(); |
| 2539 | 2539 |
| 2540 EXPECT_EQ(0, mock_new_card_bubble_controller()->bubbles_shown()); | 2540 EXPECT_EQ(0, mock_new_card_bubble_controller()->bubbles_shown()); |
| 2541 } | 2541 } |
| 2542 | 2542 |
| 2543 } // namespace autofill | 2543 } // namespace autofill |
| OLD | NEW |