| 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 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2111 | 2111 |
| 2112 controller()->EditClickedForSection(SECTION_EMAIL); | 2112 controller()->EditClickedForSection(SECTION_EMAIL); |
| 2113 EXPECT_TRUE(controller()->ShouldOfferToSaveInChrome()); | 2113 EXPECT_TRUE(controller()->ShouldOfferToSaveInChrome()); |
| 2114 | 2114 |
| 2115 controller()->EditCancelledForSection(SECTION_EMAIL); | 2115 controller()->EditCancelledForSection(SECTION_EMAIL); |
| 2116 EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome()); | 2116 EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome()); |
| 2117 | 2117 |
| 2118 controller()->MenuModelForSection(SECTION_EMAIL)->ActivatedAt(1); | 2118 controller()->MenuModelForSection(SECTION_EMAIL)->ActivatedAt(1); |
| 2119 EXPECT_TRUE(controller()->ShouldOfferToSaveInChrome()); | 2119 EXPECT_TRUE(controller()->ShouldOfferToSaveInChrome()); |
| 2120 | 2120 |
| 2121 profile()->set_incognito(true); | 2121 profile()->ForceIncognito(true); |
| 2122 EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome()); | 2122 EXPECT_FALSE(controller()->ShouldOfferToSaveInChrome()); |
| 2123 } | 2123 } |
| 2124 | 2124 |
| 2125 // Tests that user is prompted when using instrument with minimal address. | 2125 // Tests that user is prompted when using instrument with minimal address. |
| 2126 TEST_F(AutofillDialogControllerTest, UpgradeMinimalAddress) { | 2126 TEST_F(AutofillDialogControllerTest, UpgradeMinimalAddress) { |
| 2127 // A minimal address being selected should trigger error validation in the | 2127 // A minimal address being selected should trigger error validation in the |
| 2128 // view. Called once for each incomplete suggestion. | 2128 // view. Called once for each incomplete suggestion. |
| 2129 EXPECT_CALL(*controller()->GetView(), UpdateForErrors()).Times(1); | 2129 EXPECT_CALL(*controller()->GetView(), UpdateForErrors()).Times(1); |
| 2130 | 2130 |
| 2131 scoped_ptr<wallet::WalletItems> wallet_items = wallet::GetTestWalletItems(); | 2131 scoped_ptr<wallet::WalletItems> wallet_items = wallet::GetTestWalletItems(); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2513 SubmitWithWalletItems(CompleteAndValidWalletItems()); | 2513 SubmitWithWalletItems(CompleteAndValidWalletItems()); |
| 2514 controller()->set_dialog_type(DIALOG_TYPE_AUTOCHECKOUT); | 2514 controller()->set_dialog_type(DIALOG_TYPE_AUTOCHECKOUT); |
| 2515 controller()->OnDidGetFullWallet(wallet::GetTestFullWallet()); | 2515 controller()->OnDidGetFullWallet(wallet::GetTestFullWallet()); |
| 2516 controller()->OnAutocheckoutError(); | 2516 controller()->OnAutocheckoutError(); |
| 2517 controller()->ViewClosed(); | 2517 controller()->ViewClosed(); |
| 2518 | 2518 |
| 2519 EXPECT_EQ(0, mock_new_card_bubble_controller()->bubbles_shown()); | 2519 EXPECT_EQ(0, mock_new_card_bubble_controller()->bubbles_shown()); |
| 2520 } | 2520 } |
| 2521 | 2521 |
| 2522 } // namespace autofill | 2522 } // namespace autofill |
| OLD | NEW |