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

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

Issue 2631133003: [Payments] Introduce basic interactive browsertests for Payment Request (Closed)
Patch Set: ObserverForTest Created 3 years, 11 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_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc b/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f4838628d8324b77a1c9122b0468a8a360a4ba18
--- /dev/null
+++ b/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <vector>
+
+#include "chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h"
+#include "components/payments/payment_request.h"
+#include "components/payments/payment_request_web_contents_manager.h"
+
+namespace payments {
+
+class PaymentRequestWebContentsManagerTest
+ : public PaymentRequestInteractiveTestBase {
+ protected:
+ PaymentRequestWebContentsManagerTest()
+ : PaymentRequestInteractiveTestBase(
+ "/payment_request_multiple_requests.html") {}
+};
+
+// If the page creates multiple PaymentRequest objects, it should not crash.
+IN_PROC_BROWSER_TEST_F(PaymentRequestWebContentsManagerTest, MultipleRequests) {
+ const std::vector<PaymentRequest*> payment_requests =
+ GetPaymentRequests(GetActiveWebContents());
+ EXPECT_EQ(5U, payment_requests.size());
+}
+
+class PaymentRequestNoShippingTest : public PaymentRequestInteractiveTestBase {
+ protected:
+ PaymentRequestNoShippingTest()
+ : PaymentRequestInteractiveTestBase(
+ "/payment_request_no_shipping_test.html") {}
+};
+
+IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenPaymentRequestSheet) {
+ InvokePaymentRequestUI();
+}
+
+} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698