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

Unified Diff: chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc

Issue 2759253002: [Web Payments] Implement item selection in lists. (Closed)
Patch Set: Assert back navigation in browser tests. Created 3 years, 9 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
Index: chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
index d1beb30abe31b47c11c9be264a4f7a3c85df3770..38c68657d66ac0c721ce4f9e16f11126680ca610 100644
--- a/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
+++ b/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
@@ -91,21 +91,28 @@ IN_PROC_BROWSER_TEST_F(PaymentMethodViewControllerTest,
static_cast<int>(DialogViewID::CHECKMARK_VIEW));
EXPECT_FALSE(checkmark_view2->visible());
+ ResetEventObserver(DialogEvent::BACK_NAVIGATION);
// Simulate selecting the second card.
ClickOnDialogViewAndWait(list_view->child_at(1));
EXPECT_EQ(request->state()->available_instruments().back().get(),
request->state()->selected_instrument());
- EXPECT_FALSE(checkmark_view->visible());
- EXPECT_TRUE(checkmark_view2->visible());
+ OpenPaymentMethodScreen();
+ list_view = dialog_view()->GetViewByID(
+ static_cast<int>(DialogViewID::PAYMENT_METHOD_SHEET_LIST_VIEW));
// Clicking on the second card again should not modify any state.
ClickOnDialogViewAndWait(list_view->child_at(1));
Mathieu 2017/03/21 19:27:36 Do we not expect it to go back to the payment meth
anthonyvd 2017/03/21 20:29:14 Good question, we can ask Bruno!
- EXPECT_EQ(request->state()->available_instruments().back().get(),
- request->state()->selected_instrument());
+ checkmark_view = list_view->child_at(0)->GetViewByID(
+ static_cast<int>(DialogViewID::CHECKMARK_VIEW));
+ checkmark_view2 = list_view->child_at(1)->GetViewByID(
+ static_cast<int>(DialogViewID::CHECKMARK_VIEW));
EXPECT_FALSE(checkmark_view->visible());
EXPECT_TRUE(checkmark_view2->visible());
+
+ EXPECT_EQ(request->state()->available_instruments().back().get(),
+ request->state()->selected_instrument());
}
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698