| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 AddCreditCard(autofill::test::GetCreditCard()); |
| 110 |
| 111 InvokePaymentRequestUI(); |
| 112 OpenPaymentMethodScreen(); |
| 113 |
| 114 views::View* list_view = dialog_view()->GetViewByID( |
| 115 static_cast<int>(DialogViewID::PAYMENT_METHOD_SHEET_LIST_VIEW)); |
| 116 EXPECT_TRUE(list_view); |
| 117 EXPECT_EQ(1, list_view->child_count()); |
| 118 |
| 119 views::View* edit_button = list_view->child_at(0)->GetViewByID( |
| 120 static_cast<int>(DialogViewID::EDIT_ITEM_BUTTON)); |
| 121 |
| 122 ResetEventObserver(DialogEvent::CREDIT_CARD_EDITOR_OPENED); |
| 123 ClickOnDialogViewAndWait(edit_button); |
| 124 } |
| 125 |
| 108 } // namespace payments | 126 } // namespace payments |
| OLD | NEW |