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

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

Issue 2851893002: [Payments] Record CanMakePayment metrics on Desktop. (Closed)
Patch Set: Windows Fix and Rebase Fix 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 <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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, OpenAndNavigateTo404) { 51 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndNavigateTo404) {
52 InvokePaymentRequestUI(); 52 InvokePaymentRequestUI();
53 53
54 ResetEventObserver(DialogEvent::DIALOG_CLOSED); 54 ResetEventObserver(DialogEvent::DIALOG_CLOSED);
55 55
56 ui_test_utils::NavigateToURL(browser(), 56 NavigateTo("/non-existent.html");
57 https_server()->GetURL("/non-existent.html"));
58 57
59 WaitForObservedEvent(); 58 WaitForObservedEvent();
60 } 59 }
61 60
62 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndNavigateToSame) { 61 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndNavigateToSame) {
63 InvokePaymentRequestUI(); 62 InvokePaymentRequestUI();
64 63
65 ResetEventObserver(DialogEvent::DIALOG_CLOSED); 64 ResetEventObserver(DialogEvent::DIALOG_CLOSED);
66 65
67 ui_test_utils::NavigateToURL( 66 NavigateTo("/payment_request_no_shipping_test.html");
68 browser(),
69 https_server()->GetURL("/payment_request_no_shipping_test.html"));
70 67
71 WaitForObservedEvent(); 68 WaitForObservedEvent();
72 } 69 }
73 70
74 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndReload) { 71 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndReload) {
75 InvokePaymentRequestUI(); 72 InvokePaymentRequestUI();
76 73
77 ResetEventObserver(DialogEvent::DIALOG_CLOSED); 74 ResetEventObserver(DialogEvent::DIALOG_CLOSED);
78 75
79 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); 76 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB);
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 EXPECT_EQ(1u, requests.size()); 311 EXPECT_EQ(1u, requests.size());
315 std::vector<std::string> supported_card_networks = 312 std::vector<std::string> supported_card_networks =
316 requests[0]->spec()->supported_card_networks(); 313 requests[0]->spec()->supported_card_networks();
317 EXPECT_EQ(3u, supported_card_networks.size()); 314 EXPECT_EQ(3u, supported_card_networks.size());
318 EXPECT_EQ("mastercard", supported_card_networks[0]); 315 EXPECT_EQ("mastercard", supported_card_networks[0]);
319 EXPECT_EQ("visa", supported_card_networks[1]); 316 EXPECT_EQ("visa", supported_card_networks[1]);
320 EXPECT_EQ("jcb", supported_card_networks[2]); 317 EXPECT_EQ("jcb", supported_card_networks[2]);
321 } 318 }
322 319
323 } // namespace payments 320 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698