| OLD | NEW |
| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 static_cast<int>(DialogViewID::CHECKMARK_VIEW)); | 107 static_cast<int>(DialogViewID::CHECKMARK_VIEW)); |
| 108 checkmark_view2 = list_view->child_at(1)->GetViewByID( | 108 checkmark_view2 = list_view->child_at(1)->GetViewByID( |
| 109 static_cast<int>(DialogViewID::CHECKMARK_VIEW)); | 109 static_cast<int>(DialogViewID::CHECKMARK_VIEW)); |
| 110 EXPECT_FALSE(checkmark_view->visible()); | 110 EXPECT_FALSE(checkmark_view->visible()); |
| 111 EXPECT_TRUE(checkmark_view2->visible()); | 111 EXPECT_TRUE(checkmark_view2->visible()); |
| 112 | 112 |
| 113 EXPECT_EQ(request->state()->available_instruments().back().get(), | 113 EXPECT_EQ(request->state()->available_instruments().back().get(), |
| 114 request->state()->selected_instrument()); | 114 request->state()->selected_instrument()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 IN_PROC_BROWSER_TEST_F(PaymentMethodViewControllerTest, EditButtonOpensEditor) { |
| 118 AddCreditCard(autofill::test::GetCreditCard()); |
| 119 |
| 120 InvokePaymentRequestUI(); |
| 121 OpenPaymentMethodScreen(); |
| 122 |
| 123 views::View* list_view = dialog_view()->GetViewByID( |
| 124 static_cast<int>(DialogViewID::PAYMENT_METHOD_SHEET_LIST_VIEW)); |
| 125 EXPECT_TRUE(list_view); |
| 126 EXPECT_EQ(1, list_view->child_count()); |
| 127 |
| 128 views::View* edit_button = list_view->child_at(0)->GetViewByID( |
| 129 static_cast<int>(DialogViewID::EDIT_ITEM_BUTTON)); |
| 130 |
| 131 ResetEventObserver(DialogEvent::CREDIT_CARD_EDITOR_OPENED); |
| 132 ClickOnDialogViewAndWait(edit_button); |
| 133 } |
| 134 |
| 117 } // namespace payments | 135 } // namespace payments |
| OLD | NEW |