| 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 17 matching lines...) Expand all Loading... |
| 28 #include "components/autofill/core/browser/credit_card.h" | 28 #include "components/autofill/core/browser/credit_card.h" |
| 29 #include "components/autofill/core/browser/personal_data_manager.h" | 29 #include "components/autofill/core/browser/personal_data_manager.h" |
| 30 #include "components/payments/content/payment_request.h" | 30 #include "components/payments/content/payment_request.h" |
| 31 #include "components/payments/content/payment_request_web_contents_manager.h" | 31 #include "components/payments/content/payment_request_web_contents_manager.h" |
| 32 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 32 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 33 #include "content/public/browser/render_frame_host.h" | 33 #include "content/public/browser/render_frame_host.h" |
| 34 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
| 35 #include "content/public/common/content_features.h" | 35 #include "content/public/common/content_features.h" |
| 36 #include "content/public/common/content_switches.h" | 36 #include "content/public/common/content_switches.h" |
| 37 #include "content/public/test/browser_test_utils.h" | 37 #include "content/public/test/browser_test_utils.h" |
| 38 #include "services/service_manager/public/cpp/interface_registry.h" | 38 #include "services/service_manager/public/cpp/binder_registry.h" |
| 39 #include "testing/gtest/include/gtest/gtest.h" | 39 #include "testing/gtest/include/gtest/gtest.h" |
| 40 #include "ui/base/test/ui_controls.h" | 40 #include "ui/base/test/ui_controls.h" |
| 41 #include "ui/events/base_event_utils.h" | 41 #include "ui/events/base_event_utils.h" |
| 42 #include "ui/events/event.h" | 42 #include "ui/events/event.h" |
| 43 #include "ui/gfx/animation/test_animation_delegate.h" | 43 #include "ui/gfx/animation/test_animation_delegate.h" |
| 44 #include "ui/gfx/geometry/point.h" | 44 #include "ui/gfx/geometry/point.h" |
| 45 #include "ui/views/controls/button/button.h" | 45 #include "ui/views/controls/button/button.h" |
| 46 #include "ui/views/controls/label.h" | 46 #include "ui/views/controls/label.h" |
| 47 #include "ui/views/controls/styled_label.h" | 47 #include "ui/views/controls/styled_label.h" |
| 48 | 48 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 74 https_server_->ServeFilesFromSourceDirectory("chrome/test/data/payments"); | 74 https_server_->ServeFilesFromSourceDirectory("chrome/test/data/payments"); |
| 75 https_server_->StartAcceptingConnections(); | 75 https_server_->StartAcceptingConnections(); |
| 76 | 76 |
| 77 GURL url = https_server()->GetURL(test_file_path_); | 77 GURL url = https_server()->GetURL(test_file_path_); |
| 78 ui_test_utils::NavigateToURL(browser(), url); | 78 ui_test_utils::NavigateToURL(browser(), url); |
| 79 | 79 |
| 80 // Starting now, PaymentRequest Mojo messages sent by the renderer will | 80 // Starting now, PaymentRequest Mojo messages sent by the renderer will |
| 81 // create PaymentRequest objects via this test's CreatePaymentRequestForTest, | 81 // create PaymentRequest objects via this test's CreatePaymentRequestForTest, |
| 82 // allowing the test to inject itself as a dialog observer. | 82 // allowing the test to inject itself as a dialog observer. |
| 83 content::WebContents* web_contents = GetActiveWebContents(); | 83 content::WebContents* web_contents = GetActiveWebContents(); |
| 84 service_manager::InterfaceRegistry* registry = | 84 service_manager::BinderRegistry* registry = |
| 85 web_contents->GetMainFrame()->GetInterfaceRegistry(); | 85 web_contents->GetMainFrame()->GetInterfaceRegistry(); |
| 86 registry->RemoveInterface(payments::mojom::PaymentRequest::Name_); | 86 registry->RemoveInterface(payments::mojom::PaymentRequest::Name_); |
| 87 registry->AddInterface( | 87 registry->AddInterface( |
| 88 base::Bind(&PaymentRequestBrowserTestBase::CreatePaymentRequestForTest, | 88 base::Bind(&PaymentRequestBrowserTestBase::CreatePaymentRequestForTest, |
| 89 base::Unretained(this), web_contents)); | 89 base::Unretained(this), web_contents)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void PaymentRequestBrowserTestBase::SetIncognito() { | 92 void PaymentRequestBrowserTestBase::SetIncognito() { |
| 93 is_incognito_ = true; | 93 is_incognito_ = true; |
| 94 } | 94 } |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 std::list<DialogEvent> event_sequence) { | 617 std::list<DialogEvent> event_sequence) { |
| 618 event_observer_ = | 618 event_observer_ = |
| 619 base::MakeUnique<DialogEventObserver>(std::move(event_sequence)); | 619 base::MakeUnique<DialogEventObserver>(std::move(event_sequence)); |
| 620 } | 620 } |
| 621 | 621 |
| 622 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { | 622 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { |
| 623 event_observer_->Wait(); | 623 event_observer_->Wait(); |
| 624 } | 624 } |
| 625 | 625 |
| 626 } // namespace payments | 626 } // namespace payments |
| OLD | NEW |