| OLD | NEW |
| 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 Loading... |
| 46 InvokePaymentRequestUI(); | 46 InvokePaymentRequestUI(); |
| 47 ResetEventObserver(DialogEvent::DIALOG_CLOSED); | 47 ResetEventObserver(DialogEvent::DIALOG_CLOSED); |
| 48 PayWithCreditCardAndWait(base::ASCIIToUTF16("123")); | 48 PayWithCreditCardAndWait(base::ASCIIToUTF16("123")); |
| 49 | 49 |
| 50 // Test that the card details were sent to the merchant. | 50 // Test that the card details were sent to the merchant. |
| 51 ExpectBodyContains(std::vector<base::string16>{ | 51 ExpectBodyContains(std::vector<base::string16>{ |
| 52 base::UTF8ToUTF16("\"cardNumber\": \"4111111111111111\""), | 52 base::UTF8ToUTF16("\"cardNumber\": \"4111111111111111\""), |
| 53 base::UTF8ToUTF16("\"cardSecurityCode\": \"123\""), | 53 base::UTF8ToUTF16("\"cardSecurityCode\": \"123\""), |
| 54 base::UTF8ToUTF16("\"cardholderName\": \"Test User\""), | 54 base::UTF8ToUTF16("\"cardholderName\": \"Test User\""), |
| 55 base::UTF8ToUTF16("\"expiryMonth\": \"11\""), | 55 base::UTF8ToUTF16("\"expiryMonth\": \"11\""), |
| 56 base::UTF8ToUTF16("\"expiryYear\": \"2017\"")}); | 56 base::UTF8ToUTF16("\"expiryYear\": \"2022\"")}); |
| 57 | 57 |
| 58 // Test that the billing address was sent to the merchant. | 58 // Test that the billing address was sent to the merchant. |
| 59 ExpectBodyContains(std::vector<base::string16>{ | 59 ExpectBodyContains(std::vector<base::string16>{ |
| 60 base::UTF8ToUTF16("\"billingAddress\": {"), | 60 base::UTF8ToUTF16("\"billingAddress\": {"), |
| 61 base::UTF8ToUTF16("\"666 Erebus St.\""), base::UTF8ToUTF16("\"Apt 8\""), | 61 base::UTF8ToUTF16("\"666 Erebus St.\""), base::UTF8ToUTF16("\"Apt 8\""), |
| 62 base::UTF8ToUTF16("\"city\": \"Elysium\""), | 62 base::UTF8ToUTF16("\"city\": \"Elysium\""), |
| 63 base::UTF8ToUTF16("\"country\": \"US\""), | 63 base::UTF8ToUTF16("\"country\": \"US\""), |
| 64 base::UTF8ToUTF16("\"organization\": \"Underworld\""), | 64 base::UTF8ToUTF16("\"organization\": \"Underworld\""), |
| 65 base::UTF8ToUTF16("\"phone\": \"16502111111\""), | 65 base::UTF8ToUTF16("\"phone\": \"16502111111\""), |
| 66 base::UTF8ToUTF16("\"postalCode\": \"91111\""), | 66 base::UTF8ToUTF16("\"postalCode\": \"91111\""), |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 PayWithCreditCardAndWait(base::ASCIIToUTF16("123")); | 183 PayWithCreditCardAndWait(base::ASCIIToUTF16("123")); |
| 184 | 184 |
| 185 // Test that the contact details were sent to the merchant. | 185 // Test that the contact details were sent to the merchant. |
| 186 ExpectBodyContains(std::vector<base::string16>{ | 186 ExpectBodyContains(std::vector<base::string16>{ |
| 187 base::UTF8ToUTF16("\"payerName\": null"), | 187 base::UTF8ToUTF16("\"payerName\": null"), |
| 188 base::UTF8ToUTF16("\"payerEmail\": \"johndoe@hades.com\""), | 188 base::UTF8ToUTF16("\"payerEmail\": \"johndoe@hades.com\""), |
| 189 base::UTF8ToUTF16("\"payerPhone\": null")}); | 189 base::UTF8ToUTF16("\"payerPhone\": null")}); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace payments | 192 } // namespace payments |
| OLD | NEW |