Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_browsertest_base.cc

Issue 2851173004: Eliminate bind callback that doesn't take a BindSourceInfo parameter. (Closed)
Patch Set: . Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 15 matching lines...) Expand all
26 #include "chrome/test/base/ui_test_utils.h" 26 #include "chrome/test/base/ui_test_utils.h"
27 #include "components/autofill/core/browser/autofill_profile.h" 27 #include "components/autofill/core/browser/autofill_profile.h"
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/test/browser_test_utils.h" 35 #include "content/public/test/browser_test_utils.h"
36 #include "services/service_manager/public/cpp/bind_source_info.h"
36 #include "services/service_manager/public/cpp/binder_registry.h" 37 #include "services/service_manager/public/cpp/binder_registry.h"
37 #include "testing/gtest/include/gtest/gtest.h" 38 #include "testing/gtest/include/gtest/gtest.h"
38 #include "ui/base/test/ui_controls.h" 39 #include "ui/base/test/ui_controls.h"
39 #include "ui/events/base_event_utils.h" 40 #include "ui/events/base_event_utils.h"
40 #include "ui/events/event.h" 41 #include "ui/events/event.h"
41 #include "ui/gfx/animation/test_animation_delegate.h" 42 #include "ui/gfx/animation/test_animation_delegate.h"
42 #include "ui/gfx/geometry/point.h" 43 #include "ui/gfx/geometry/point.h"
43 #include "ui/views/controls/button/button.h" 44 #include "ui/views/controls/button/button.h"
44 #include "ui/views/controls/label.h" 45 #include "ui/views/controls/label.h"
45 #include "ui/views/controls/styled_label.h" 46 #include "ui/views/controls/styled_label.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 .WillOnce(QuitMessageLoop(&data_loop)); 384 .WillOnce(QuitMessageLoop(&data_loop));
384 personal_data_manager->AddCreditCard(card); 385 personal_data_manager->AddCreditCard(card);
385 data_loop.Run(); 386 data_loop.Run();
386 387
387 personal_data_manager->RemoveObserver(&personal_data_observer); 388 personal_data_manager->RemoveObserver(&personal_data_observer);
388 EXPECT_EQ(card_count + 1, personal_data_manager->GetCreditCards().size()); 389 EXPECT_EQ(card_count + 1, personal_data_manager->GetCreditCards().size());
389 } 390 }
390 391
391 void PaymentRequestBrowserTestBase::CreatePaymentRequestForTest( 392 void PaymentRequestBrowserTestBase::CreatePaymentRequestForTest(
392 content::WebContents* web_contents, 393 content::WebContents* web_contents,
393 mojo::InterfaceRequest<payments::mojom::PaymentRequest> request) { 394 const service_manager::BindSourceInfo& source_info,
395 payments::mojom::PaymentRequestRequest request) {
394 DCHECK(web_contents); 396 DCHECK(web_contents);
395 std::unique_ptr<TestChromePaymentRequestDelegate> delegate = 397 std::unique_ptr<TestChromePaymentRequestDelegate> delegate =
396 base::MakeUnique<TestChromePaymentRequestDelegate>( 398 base::MakeUnique<TestChromePaymentRequestDelegate>(
397 web_contents, this /* observer */, this /* widget_observer */, 399 web_contents, this /* observer */, this /* widget_observer */,
398 is_incognito_, is_valid_ssl_); 400 is_incognito_, is_valid_ssl_);
399 delegate_ = delegate.get(); 401 delegate_ = delegate.get();
400 PaymentRequestWebContentsManager::GetOrCreateForWebContents(web_contents) 402 PaymentRequestWebContentsManager::GetOrCreateForWebContents(web_contents)
401 ->CreatePaymentRequest(web_contents, std::move(delegate), 403 ->CreatePaymentRequest(web_contents, std::move(delegate),
402 std::move(request), this); 404 std::move(request), this);
403 } 405 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 std::list<DialogEvent> event_sequence) { 637 std::list<DialogEvent> event_sequence) {
636 event_observer_ = 638 event_observer_ =
637 base::MakeUnique<DialogEventObserver>(std::move(event_sequence)); 639 base::MakeUnique<DialogEventObserver>(std::move(event_sequence));
638 } 640 }
639 641
640 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { 642 void PaymentRequestBrowserTestBase::WaitForObservedEvent() {
641 event_observer_->Wait(); 643 event_observer_->Wait();
642 } 644 }
643 645
644 } // namespace payments 646 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698