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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc

Issue 171783003: rAc: partial revert of 251484 to show correct sections in views dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_view_tester.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
index 8a1279a60740801c4ff1c7b8d5446add1ecbca31..f6b6873771ddd58b768c0eb0fc766cf361c558f4 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc
@@ -1304,6 +1304,34 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, RefreshOnManageTabClose) {
GetActiveWebContents()->Close();
}
+// Changes from Wallet to Autofill and verifies that the combined billing/cc
+// sections are showing (or not) at the correct times.
+IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest,
+ ChangingDataSourceShowsCorrectSections) {
+ scoped_ptr<AutofillDialogViewTester> view = GetViewTester();
+ EXPECT_TRUE(view->IsShowingSection(SECTION_CC));
+ EXPECT_TRUE(view->IsShowingSection(SECTION_BILLING));
+ EXPECT_FALSE(view->IsShowingSection(SECTION_CC_BILLING));
+
+ // Switch the dialog to paying with Wallet.
+ controller()->OnDidFetchWalletCookieValue(std::string());
+ controller()->OnDidGetWalletItems(
+ wallet::GetTestWalletItems(wallet::AMEX_DISALLOWED));
+ ASSERT_TRUE(controller()->IsPayingWithWallet());
+
+ EXPECT_FALSE(view->IsShowingSection(SECTION_CC));
+ EXPECT_FALSE(view->IsShowingSection(SECTION_BILLING));
+ EXPECT_TRUE(view->IsShowingSection(SECTION_CC_BILLING));
+
+ // Now switch back to Autofill to ensure this direction works as well.
+ ui::MenuModel* account_chooser = controller()->MenuModelForAccountChooser();
+ account_chooser->ActivatedAt(account_chooser->GetItemCount() - 1);
+
+ EXPECT_TRUE(view->IsShowingSection(SECTION_CC));
+ EXPECT_TRUE(view->IsShowingSection(SECTION_BILLING));
+ EXPECT_FALSE(view->IsShowingSection(SECTION_CC_BILLING));
+}
+
// http://crbug.com/318526
#if defined(OS_MACOSX)
#define MAYBE_DoesWorkOnHttpWithFlag DISABLED_DoesWorkOnHttpWithFlag
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_view_tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698