| 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 "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 base::RunLoop().Run(); | 565 base::RunLoop().Run(); |
| 566 } else if (view_stack->slide_out_animator_->IsAnimating()) { | 566 } else if (view_stack->slide_out_animator_->IsAnimating()) { |
| 567 view_stack->slide_out_animator_->SetAnimationDuration(1); | 567 view_stack->slide_out_animator_->SetAnimationDuration(1); |
| 568 view_stack->slide_out_animator_->SetAnimationDelegate( | 568 view_stack->slide_out_animator_->SetAnimationDelegate( |
| 569 view_stack->top(), std::unique_ptr<gfx::AnimationDelegate>( | 569 view_stack->top(), std::unique_ptr<gfx::AnimationDelegate>( |
| 570 new gfx::TestAnimationDelegate())); | 570 new gfx::TestAnimationDelegate())); |
| 571 base::RunLoop().Run(); | 571 base::RunLoop().Run(); |
| 572 } | 572 } |
| 573 } | 573 } |
| 574 | 574 |
| 575 const base::string16& PaymentRequestBrowserTestBase::GetLabelText( |
| 576 DialogViewID view_id) { |
| 577 views::View* view = dialog_view()->GetViewByID(static_cast<int>(view_id)); |
| 578 DCHECK(view); |
| 579 return static_cast<views::Label*>(view)->text(); |
| 580 } |
| 581 |
| 575 const base::string16& PaymentRequestBrowserTestBase::GetStyledLabelText( | 582 const base::string16& PaymentRequestBrowserTestBase::GetStyledLabelText( |
| 576 DialogViewID view_id) { | 583 DialogViewID view_id) { |
| 577 views::View* view = dialog_view()->GetViewByID(static_cast<int>(view_id)); | 584 views::View* view = dialog_view()->GetViewByID(static_cast<int>(view_id)); |
| 578 DCHECK(view); | 585 DCHECK(view); |
| 579 return static_cast<views::StyledLabel*>(view)->text(); | 586 return static_cast<views::StyledLabel*>(view)->text(); |
| 580 } | 587 } |
| 581 | 588 |
| 582 const base::string16& PaymentRequestBrowserTestBase::GetErrorLabelForType( | 589 const base::string16& PaymentRequestBrowserTestBase::GetErrorLabelForType( |
| 583 autofill::ServerFieldType type) { | 590 autofill::ServerFieldType type) { |
| 584 views::View* view = dialog_view()->GetViewByID( | 591 views::View* view = dialog_view()->GetViewByID( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 std::list<DialogEvent> event_sequence) { | 628 std::list<DialogEvent> event_sequence) { |
| 622 event_observer_ = | 629 event_observer_ = |
| 623 base::MakeUnique<DialogEventObserver>(std::move(event_sequence)); | 630 base::MakeUnique<DialogEventObserver>(std::move(event_sequence)); |
| 624 } | 631 } |
| 625 | 632 |
| 626 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { | 633 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { |
| 627 event_observer_->Wait(); | 634 event_observer_->Wait(); |
| 628 } | 635 } |
| 629 | 636 |
| 630 } // namespace payments | 637 } // namespace payments |
| OLD | NEW |