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

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

Issue 1877943002: Add unit test for providing empty list of detail items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comment Created 4 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 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/PaymentRequestTest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
index 985006d73822f75664a1b59358fc9ea839d47800..da50d216323f4809dd14e9e74d33247981940f51 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
@@ -76,6 +76,17 @@ TEST_F(PaymentRequestTest, ItemListRequired)
EXPECT_EQ(V8TypeError, getExceptionState().code());
}
+TEST_F(PaymentRequestTest, ItemListIsNotEmpty)
+{
+ PaymentDetails details;
+ details.setItems(HeapVector<PaymentItem>());
+
+ PaymentRequest::create(getScriptState(), Vector<String>(1, "foo"), details, getExceptionState());
+
+ EXPECT_TRUE(getExceptionState().hadException());
+ EXPECT_EQ(V8TypeError, getExceptionState().code());
+}
+
TEST_F(PaymentRequestTest, AtLeastOnePaymentDetailsItemRequired)
{
PaymentDetails details;
« 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