| 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 <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 views::View* view = | 291 views::View* view = |
| 292 delegate_->dialog_view()->GetViewByID(static_cast<int>(view_id)); | 292 delegate_->dialog_view()->GetViewByID(static_cast<int>(view_id)); |
| 293 DCHECK(view); | 293 DCHECK(view); |
| 294 ClickOnDialogViewAndWait(view, wait_for_animation); | 294 ClickOnDialogViewAndWait(view, wait_for_animation); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void PaymentRequestBrowserTestBase::ClickOnDialogViewAndWait( | 297 void PaymentRequestBrowserTestBase::ClickOnDialogViewAndWait( |
| 298 views::View* view, | 298 views::View* view, |
| 299 bool wait_for_animation) { | 299 bool wait_for_animation) { |
| 300 DCHECK(view); | 300 DCHECK(view); |
| 301 ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), | 301 ui::MouseEvent pressed( |
| 302 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, | 302 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), |
| 303 ui::EF_LEFT_MOUSE_BUTTON); | 303 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 304 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)); |
| 304 view->OnMousePressed(pressed); | 305 view->OnMousePressed(pressed); |
| 305 ui::MouseEvent released_event = ui::MouseEvent( | 306 ui::MouseEvent released_event = ui::MouseEvent( |
| 306 ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), | 307 ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), |
| 307 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); | 308 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON, |
| 309 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)); |
| 308 view->OnMouseReleased(released_event); | 310 view->OnMouseReleased(released_event); |
| 309 | 311 |
| 310 if (wait_for_animation) | 312 if (wait_for_animation) |
| 311 WaitForAnimation(); | 313 WaitForAnimation(); |
| 312 | 314 |
| 313 WaitForObservedEvent(); | 315 WaitForObservedEvent(); |
| 314 } | 316 } |
| 315 | 317 |
| 316 void PaymentRequestBrowserTestBase::SetEditorTextfieldValue( | 318 void PaymentRequestBrowserTestBase::SetEditorTextfieldValue( |
| 317 const base::string16& value, | 319 const base::string16& value, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 419 |
| 418 void PaymentRequestBrowserTestBase::ResetEventObserver(DialogEvent event) { | 420 void PaymentRequestBrowserTestBase::ResetEventObserver(DialogEvent event) { |
| 419 event_observer_ = base::MakeUnique<DialogEventObserver>(event); | 421 event_observer_ = base::MakeUnique<DialogEventObserver>(event); |
| 420 } | 422 } |
| 421 | 423 |
| 422 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { | 424 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { |
| 423 event_observer_->Wait(); | 425 event_observer_->Wait(); |
| 424 } | 426 } |
| 425 | 427 |
| 426 } // namespace payments | 428 } // namespace payments |
| OLD | NEW |