OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MockPaymentRequest_h |
| 6 #define MockPaymentRequest_h |
| 7 |
| 8 #include "modules/payments/PaymentRequest.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class ExceptionState; |
| 14 class ScriptState; |
| 15 |
| 16 enum DetailToChange { |
| 17 DetailNone, |
| 18 DetailItem, |
| 19 DetailShippingOption |
| 20 }; |
| 21 |
| 22 enum DataToChange { |
| 23 DataNone, |
| 24 DataId, |
| 25 DataLabel, |
| 26 DataCurrencyCode, |
| 27 DataAmount |
| 28 }; |
| 29 |
| 30 enum ModificationType { |
| 31 OverwriteValue, |
| 32 RemoveKey |
| 33 }; |
| 34 |
| 35 class MockPaymentRequest : public PaymentRequest { |
| 36 public: |
| 37 static PaymentDetails buildDetails(DetailToChange = DetailNone, DataToChange
= DataNone, ModificationType = OverwriteValue, const String& valueToUse = Strin
g()); |
| 38 |
| 39 MockPaymentRequest(ScriptState*, const Vector<String>& supportedMethods, con
st PaymentDetails&, ExceptionState&); |
| 40 ~MockPaymentRequest() override; |
| 41 |
| 42 MOCK_METHOD2(complete, ScriptPromise(ScriptState*, bool success)); |
| 43 |
| 44 private: |
| 45 ScriptPromise m_dummyPromise; |
| 46 }; |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif // MockPaymentRequest_h |
OLD | NEW |