| 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 "bindings/core/v8/V8BindingForTesting.h" | 9 #include "bindings/core/v8/V8BindingForTesting.h" |
| 10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
| 11 #include "core/dom/ExceptionCode.h" | 11 #include "core/dom/ExceptionCode.h" |
| 12 #include "modules/payments/PaymentDetails.h" | 12 #include "modules/payments/PaymentDetails.h" |
| 13 #include "modules/payments/PaymentTestHelper.h" | 13 #include "modules/payments/PaymentTestHelper.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "wtf/OwnPtr.h" |
| 15 #include <ostream> // NOLINT | 16 #include <ostream> // NOLINT |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 class DetailsTestCase { | 21 class DetailsTestCase { |
| 21 public: | 22 public: |
| 22 DetailsTestCase(PaymentTestDetailToChange detail, PaymentTestDataToChange da
ta, PaymentTestModificationType modType, const char* valueToUse, bool expectExce
ption = false, ExceptionCode expectedExceptionCode = 0) | 23 DetailsTestCase(PaymentTestDetailToChange detail, PaymentTestDataToChange da
ta, PaymentTestModificationType modType, const char* valueToUse, bool expectExce
ption = false, ExceptionCode expectedExceptionCode = 0) |
| 23 : m_detail(detail) | 24 : m_detail(detail) |
| 24 , m_data(data) | 25 , m_data(data) |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "10.", true, V8TypeError), | 258 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "10.", true, V8TypeError), |
| 258 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, ".99", true, V8TypeError), | 259 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, ".99", true, V8TypeError), |
| 259 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "-10.", true, V8TypeError), | 260 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "-10.", true, V8TypeError), |
| 260 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "10-", true, V8TypeError), | 261 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "10-", true, V8TypeError), |
| 261 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1-0", true, V8TypeError), | 262 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1-0", true, V8TypeError), |
| 262 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1.0.0", true, V8TypeError), | 263 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1.0.0", true, V8TypeError), |
| 263 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1/3", true, V8TypeError))); | 264 DetailsTestCase(PaymentTestDetailShippingOption, PaymentTestDataValue, P
aymentTestOverwriteValue, "1/3", true, V8TypeError))); |
| 264 | 265 |
| 265 } // namespace | 266 } // namespace |
| 266 } // namespace blink | 267 } // namespace blink |
| OLD | NEW |