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

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: 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 | « third_party/WebKit/Source/modules/payments/PaymentDetailsTestHelper.cpp ('k') | 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..b79392da285d5122a8055a27aa985fe8cc8817c6 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
@@ -76,6 +76,14 @@ TEST_F(PaymentRequestTest, ItemListRequired)
EXPECT_EQ(V8TypeError, getExceptionState().code());
}
+TEST_F(PaymentRequestTest, ItemListIsNotEmpty)
+{
+ PaymentRequest::create(getScriptState(), Vector<String>(1, "foo"), buildPaymentDetailsForTest(PaymentTestDetailNoItems), getExceptionState());
please use gerrit instead 2016/04/11 21:46:36 I would prefer this to be: -----------------------
rwlbuis 2016/04/12 01:19:16 Good idea, done :)
+
+ EXPECT_TRUE(getExceptionState().hadException());
+ EXPECT_EQ(V8TypeError, getExceptionState().code());
+}
+
TEST_F(PaymentRequestTest, AtLeastOnePaymentDetailsItemRequired)
{
PaymentDetails details;
« no previous file with comments | « third_party/WebKit/Source/modules/payments/PaymentDetailsTestHelper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698