OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "modules/payments/PaymentRequest.h" | 5 #include "modules/payments/PaymentRequest.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
10 #include "core/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 if (GetParam().expectException()) | 85 if (GetParam().expectException()) |
86 EXPECT_EQ(GetParam().getExpectedExceptionCode(), getExceptionState().cod
e()); | 86 EXPECT_EQ(GetParam().getExpectedExceptionCode(), getExceptionState().cod
e()); |
87 } | 87 } |
88 | 88 |
89 INSTANTIATE_TEST_CASE_P(MissingData, | 89 INSTANTIATE_TEST_CASE_P(MissingData, |
90 PaymentRequestDetailsTest, | 90 PaymentRequestDetailsTest, |
91 testing::Values( | 91 testing::Values( |
92 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataAmount, PaymentTes
tRemoveKey, "", true, V8TypeError), | 92 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataAmount, PaymentTes
tRemoveKey, "", true, V8TypeError), |
93 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataValue, PaymentTest
RemoveKey, "", true, V8TypeError), | 93 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataValue, PaymentTest
RemoveKey, "", true, V8TypeError), |
94 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataCurrencyCode, Paym
entTestRemoveKey, "", true, V8TypeError), | 94 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataCurrencyCode, Paym
entTestRemoveKey, "", true, V8TypeError), |
95 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataId, PaymentTestRem
oveKey, "", true, V8TypeError), | |
96 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataLabel, PaymentTest
RemoveKey, "", true, V8TypeError), | 95 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataLabel, PaymentTest
RemoveKey, "", true, V8TypeError), |
97 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataAmount,
PaymentTestRemoveKey, "", true, V8TypeError), | 96 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataAmount,
PaymentTestRemoveKey, "", true, V8TypeError), |
98 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestRemoveKey, "", true, V8TypeError), | 97 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestRemoveKey, "", true, V8TypeError), |
99 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataCurrency
Code, PaymentTestRemoveKey, "", true, V8TypeError), | 98 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataCurrency
Code, PaymentTestRemoveKey, "", true, V8TypeError), |
100 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataId, Paym
entTestRemoveKey, "", true, V8TypeError), | 99 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataId, Paym
entTestRemoveKey, "", true, V8TypeError), |
101 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataLabel, P
aymentTestRemoveKey, "", true, V8TypeError))); | 100 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataLabel, P
aymentTestRemoveKey, "", true, V8TypeError))); |
102 | 101 |
103 INSTANTIATE_TEST_CASE_P(EmptyData, | 102 INSTANTIATE_TEST_CASE_P(EmptyData, |
104 PaymentRequestDetailsTest, | 103 PaymentRequestDetailsTest, |
105 testing::Values( | 104 testing::Values( |
106 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataValue, PaymentTest
OverwriteValue, "", true, V8TypeError), | 105 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataValue, PaymentTest
OverwriteValue, "", true, V8TypeError), |
107 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataCurrencyCode, Paym
entTestOverwriteValue, "", true, V8TypeError), | 106 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataCurrencyCode, Paym
entTestOverwriteValue, "", true, V8TypeError), |
108 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataId, PaymentTestOve
rwriteValue, "", true, V8TypeError), | |
109 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataLabel, PaymentTest
OverwriteValue, "", true, V8TypeError), | 107 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataLabel, PaymentTest
OverwriteValue, "", true, V8TypeError), |
110 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "", true, V8TypeError), | 108 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "", true, V8TypeError), |
111 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataCurrency
Code, PaymentTestOverwriteValue, "", true, V8TypeError), | 109 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataCurrency
Code, PaymentTestOverwriteValue, "", true, V8TypeError), |
112 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataId, Paym
entTestOverwriteValue, "", true, V8TypeError), | 110 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataId, Paym
entTestOverwriteValue, "", true, V8TypeError), |
113 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataLabel, P
aymentTestOverwriteValue, "", true, V8TypeError))); | 111 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataLabel, P
aymentTestOverwriteValue, "", true, V8TypeError))); |
114 | 112 |
115 INSTANTIATE_TEST_CASE_P(ValidCurrencyCodeFormat, | 113 INSTANTIATE_TEST_CASE_P(ValidCurrencyCodeFormat, |
116 PaymentRequestDetailsTest, | 114 PaymentRequestDetailsTest, |
117 testing::Values( | 115 testing::Values( |
118 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataCurrencyCode, Paym
entTestOverwriteValue, "USD"), | 116 DetailsTestCase(PaymentTestDetailItem, PaymentTestDataCurrencyCode, Paym
entTestOverwriteValue, "USD"), |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "10.", true, V8TypeError), | 181 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "10.", true, V8TypeError), |
184 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, ".99", true, V8TypeError), | 182 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, ".99", true, V8TypeError), |
185 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "-10.", true, V8TypeError), | 183 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "-10.", true, V8TypeError), |
186 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "10-", true, V8TypeError), | 184 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "10-", true, V8TypeError), |
187 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1-0", true, V8TypeError), | 185 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1-0", true, V8TypeError), |
188 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1.0.0", true, V8TypeError), | 186 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1.0.0", true, V8TypeError), |
189 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1/3", true, V8TypeError))); | 187 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1/3", true, V8TypeError))); |
190 | 188 |
191 } // namespace | 189 } // namespace |
192 } // namespace blink | 190 } // namespace blink |
OLD | NEW |