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

Side by Side Diff: chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc

Issue 2872623002: [Web Payments] Add "pencil" edit button to lists. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" 6 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h"
7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
8 #include "components/autofill/core/browser/autofill_test_utils.h" 8 #include "components/autofill/core/browser/autofill_test_utils.h"
9 #include "components/autofill/core/browser/personal_data_manager.h" 9 #include "components/autofill/core/browser/personal_data_manager.h"
10 #include "components/payments/content/payment_request.h" 10 #include "components/payments/content/payment_request.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 static_cast<int>(DialogViewID::CHECKMARK_VIEW)); 98 static_cast<int>(DialogViewID::CHECKMARK_VIEW));
99 checkmark_view2 = list_view->child_at(1)->GetViewByID( 99 checkmark_view2 = list_view->child_at(1)->GetViewByID(
100 static_cast<int>(DialogViewID::CHECKMARK_VIEW)); 100 static_cast<int>(DialogViewID::CHECKMARK_VIEW));
101 EXPECT_FALSE(checkmark_view->visible()); 101 EXPECT_FALSE(checkmark_view->visible());
102 EXPECT_TRUE(checkmark_view2->visible()); 102 EXPECT_TRUE(checkmark_view2->visible());
103 103
104 EXPECT_EQ(request->state()->available_instruments().back().get(), 104 EXPECT_EQ(request->state()->available_instruments().back().get(),
105 request->state()->selected_instrument()); 105 request->state()->selected_instrument());
106 } 106 }
107 107
108 IN_PROC_BROWSER_TEST_F(PaymentMethodViewControllerTest, EditButtonOpensEditor) {
109 const autofill::CreditCard card = autofill::test::GetCreditCard();
110 AddCreditCard(card);
Mathieu 2017/05/08 14:08:02 nit: you can inline autofill::test::GetCreditCard(
anthonyvd 2017/05/08 14:45:53 Done.
111
112 InvokePaymentRequestUI();
113 OpenPaymentMethodScreen();
114
115 views::View* list_view = dialog_view()->GetViewByID(
116 static_cast<int>(DialogViewID::PAYMENT_METHOD_SHEET_LIST_VIEW));
117 EXPECT_TRUE(list_view);
118 EXPECT_EQ(1, list_view->child_count());
119
120 views::View* edit_button = list_view->child_at(0)->GetViewByID(
121 static_cast<int>(DialogViewID::EDIT_ITEM_BUTTON));
122
123 ResetEventObserver(DialogEvent::CREDIT_CARD_EDITOR_OPENED);
124 ClickOnDialogViewAndWait(edit_button);
125 }
126
108 } // namespace payments 127 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698