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

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

Issue 2789093002: [Payments] Desktop: implement shipping address/option change (Closed)
Patch Set: compile fix Created 3 years, 8 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 <vector> 5 #include <vector>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" 10 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h"
(...skipping 30 matching lines...) Expand all
41 class PaymentRequestNoShippingTest : public PaymentRequestBrowserTestBase { 41 class PaymentRequestNoShippingTest : public PaymentRequestBrowserTestBase {
42 protected: 42 protected:
43 PaymentRequestNoShippingTest() 43 PaymentRequestNoShippingTest()
44 : PaymentRequestBrowserTestBase( 44 : PaymentRequestBrowserTestBase(
45 "/payment_request_no_shipping_test.html") {} 45 "/payment_request_no_shipping_test.html") {}
46 46
47 private: 47 private:
48 DISALLOW_COPY_AND_ASSIGN(PaymentRequestNoShippingTest); 48 DISALLOW_COPY_AND_ASSIGN(PaymentRequestNoShippingTest);
49 }; 49 };
50 50
51 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest,
52 OpenAndNavigateToOrderSummary) {
53 InvokePaymentRequestUI();
54
55 OpenOrderSummaryScreen();
56
57 // Verify the expected amounts are shown.
58 EXPECT_EQ(base::ASCIIToUTF16("USD $5.00"),
59 GetStyledLabelText(DialogViewID::ORDER_SUMMARY_TOTAL_AMOUNT_LABEL));
60 EXPECT_EQ(base::ASCIIToUTF16("$4.50"),
61 GetStyledLabelText(DialogViewID::ORDER_SUMMARY_LINE_ITEM_1));
62 EXPECT_EQ(base::ASCIIToUTF16("$0.50"),
63 GetStyledLabelText(DialogViewID::ORDER_SUMMARY_LINE_ITEM_2));
64 }
65
66 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndNavigateTo404) { 51 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndNavigateTo404) {
67 InvokePaymentRequestUI(); 52 InvokePaymentRequestUI();
68 53
69 ResetEventObserver(DialogEvent::DIALOG_CLOSED); 54 ResetEventObserver(DialogEvent::DIALOG_CLOSED);
70 55
71 ui_test_utils::NavigateToURL(browser(), 56 ui_test_utils::NavigateToURL(browser(),
72 https_server()->GetURL("/non-existent.html")); 57 https_server()->GetURL("/non-existent.html"));
73 58
74 WaitForObservedEvent(); 59 WaitForObservedEvent();
75 } 60 }
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 EXPECT_EQ(1u, requests.size()); 274 EXPECT_EQ(1u, requests.size());
290 std::vector<std::string> supported_card_networks = 275 std::vector<std::string> supported_card_networks =
291 requests[0]->spec()->supported_card_networks(); 276 requests[0]->spec()->supported_card_networks();
292 EXPECT_EQ(3u, supported_card_networks.size()); 277 EXPECT_EQ(3u, supported_card_networks.size());
293 EXPECT_EQ("mastercard", supported_card_networks[0]); 278 EXPECT_EQ("mastercard", supported_card_networks[0]);
294 EXPECT_EQ("visa", supported_card_networks[1]); 279 EXPECT_EQ("visa", supported_card_networks[1]);
295 EXPECT_EQ("jcb", supported_card_networks[2]); 280 EXPECT_EQ("jcb", supported_card_networks[2]);
296 } 281 }
297 282
298 } // namespace payments 283 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698