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

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

Issue 2171973005: Add test to check that the payment response details field is a JSON-serializable object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/payments/PaymentResponseTest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentResponseTest.cpp b/third_party/WebKit/Source/modules/payments/PaymentResponseTest.cpp
index 35da551475c3540bd99e0d0fd453386bf6539029..a683458a27bf5385b82e161d780763bacddc7eaf 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentResponseTest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentResponseTest.cpp
@@ -69,6 +69,19 @@ TEST(PaymentResponseTest, DataCopiedOver)
EXPECT_EQ(123, transactionId.v8Value().As<v8::Number>()->Value());
}
+TEST(PaymentResponseTest, PaymentResponseDetailsJSONObject)
+{
+ V8TestingScope scope;
+ mojom::blink::PaymentResponsePtr input = buildPaymentResponseForTest();
+ input->stringified_details = "transactionId";
+ MockPaymentCompleter* completeCallback = new MockPaymentCompleter;
+ PaymentResponse output(std::move(input), completeCallback);
+
+ ScriptValue details = output.details(scope.getScriptState(), scope.getExceptionState());
+
+ ASSERT_TRUE(scope.getExceptionState().hadException());
+}
+
TEST(PaymentResponseTest, CompleteCalledWithSuccess)
{
V8TestingScope scope;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698