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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentAppRequestConversionTest.cpp

Issue 2887713002: PaymentHandler: Merge PaymentAppRequest and PaymentRequestEvent. (Closed)
Patch Set: PaymentHandler: Merge PaymentAppRequest and PaymentRequestEvent. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/payments/PaymentAppRequestConversionTest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAppRequestConversionTest.cpp b/third_party/WebKit/Source/modules/payments/PaymentAppRequestConversionTest.cpp
index 007f45e1a8da45aaf83d4fb02ffa2db9c3b5eda3..d7dae72b6b0ca254047eb0068c7efc1f52b518d0 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentAppRequestConversionTest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentAppRequestConversionTest.cpp
@@ -33,12 +33,14 @@ static WebPaymentMethodData CreateWebPaymentMethodDataForTest() {
static WebPaymentAppRequest CreateWebPaymentAppRequestForTest() {
WebPaymentAppRequest web_data;
- web_data.origin = WebString::FromUTF8("https://example.com");
+ web_data.top_level_origin = WebString::FromUTF8("https://example.com");
+ web_data.payment_request_origin = WebString::FromUTF8("https://example.com");
+ web_data.payment_request_id = WebString::FromUTF8("payment-request-id");
Vector<WebPaymentMethodData> method_data;
method_data.push_back(CreateWebPaymentMethodDataForTest());
web_data.method_data = WebVector<WebPaymentMethodData>(method_data);
web_data.total = CreateWebPaymentItemForTest();
- web_data.option_id = WebString::FromUTF8("payment-app-id");
+ web_data.instrument_key = WebString::FromUTF8("payment-instrument-key");
return web_data;
}
@@ -48,6 +50,15 @@ TEST(PaymentAppRequestConversionTest, ToPaymentAppRequest) {
PaymentAppRequest data = PaymentAppRequestConversion::ToPaymentAppRequest(
scope.GetScriptState(), web_data);
+ ASSERT_TRUE(data.hasTopLevelOrigin());
+ EXPECT_EQ("https://example.com", data.topLevelOrigin());
+
+ ASSERT_TRUE(data.hasPaymentRequestOrigin());
+ EXPECT_EQ("https://example.com", data.paymentRequestOrigin());
+
+ ASSERT_TRUE(data.hasPaymentRequestId());
+ EXPECT_EQ("payment-request-id", data.paymentRequestId());
+
ASSERT_TRUE(data.hasMethodData());
ASSERT_EQ(1UL, data.methodData().size());
ASSERT_TRUE(data.methodData().front().hasSupportedMethods());
@@ -72,11 +83,8 @@ TEST(PaymentAppRequestConversionTest, ToPaymentAppRequest) {
ASSERT_TRUE(data.total().amount().hasValue());
EXPECT_EQ("9.99", data.total().amount().value());
- ASSERT_TRUE(data.hasOptionId());
- EXPECT_EQ("payment-app-id", data.optionId());
-
- ASSERT_TRUE(data.hasOrigin());
- EXPECT_EQ("https://example.com", data.origin());
+ ASSERT_TRUE(data.hasInstrumentKey());
+ EXPECT_EQ("payment-instrument-key", data.instrumentKey());
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698