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

Unified Diff: chrome/browser/ui/views/payments/payment_request_browsertest_base.cc

Issue 2772103002: [Payments] Desktop: never return false in incognito mode for canMakePayment (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc b/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
index 968166c2a058aafb1b4fb887b3e3706c38d629fe..1ca549b221a8385d73ff644d72f9f74662d9978a 100644
--- a/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
+++ b/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
@@ -52,7 +52,9 @@ PersonalDataLoadedObserverMock::~PersonalDataLoadedObserverMock() {}
PaymentRequestBrowserTestBase::PaymentRequestBrowserTestBase(
const std::string& test_file_path)
- : test_file_path_(test_file_path), delegate_(nullptr) {}
+ : test_file_path_(test_file_path),
+ delegate_(nullptr),
+ incognito_for_testing_(false) {}
PaymentRequestBrowserTestBase::~PaymentRequestBrowserTestBase() {}
void PaymentRequestBrowserTestBase::SetUpCommandLine(
@@ -85,6 +87,10 @@ void PaymentRequestBrowserTestBase::SetUpOnMainThread() {
base::Unretained(this), web_contents));
}
+void PaymentRequestBrowserTestBase::SetIncognitoForTesting() {
+ incognito_for_testing_ = true;
+}
+
void PaymentRequestBrowserTestBase::OnDialogOpened() {
if (event_observer_)
event_observer_->Observe(DialogEvent::DIALOG_OPENED);
@@ -261,7 +267,8 @@ void PaymentRequestBrowserTestBase::CreatePaymentRequestForTest(
DCHECK(web_contents);
std::unique_ptr<TestChromePaymentRequestDelegate> delegate =
base::MakeUnique<TestChromePaymentRequestDelegate>(
- web_contents, this /* observer */, this /* widget_observer */);
+ web_contents, this /* observer */, this /* widget_observer */,
+ incognito_for_testing_);
delegate_ = delegate.get();
PaymentRequestWebContentsManager::GetOrCreateForWebContents(web_contents)
->CreatePaymentRequest(web_contents, std::move(delegate),

Powered by Google App Engine
This is Rietveld 408576698