OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 FakeRemoteGATTCharacteristic_h |
| 6 #define FakeRemoteGATTCharacteristic_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "core/dom/DOMArrayPiece.h" |
| 11 #include "modules/bluetooth/FakeRemoteGATTDescriptor.h" |
| 12 #include "platform/heap/Handle.h" |
| 13 #include "platform/heap/Heap.h" |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 class FakeNotificationOptions; |
| 18 class FakeRemoteGATTDescriptorOptions; |
| 19 class FakeRemoteGATTDescriptor; |
| 20 |
| 21 class FakeRemoteGATTCharacteristic : public GarbageCollected<FakeRemoteGATTChara
cteristic>, |
| 22 public ScriptWrappable { |
| 23 DEFINE_WRAPPERTYPEINFO(); |
| 24 |
| 25 public: |
| 26 static FakeRemoteGATTCharacteristic* create() { return new FakeRemoteGATTChara
cteristic(); } |
| 27 |
| 28 ScriptPromise simulateRead(ScriptState*, String gattResult); |
| 29 ScriptPromise simulateRead(ScriptState*, String gattResult, const DOMArrayPiec
e&); |
| 30 ScriptPromise simulateWriteWithResponse(ScriptState*, String gattResult); |
| 31 ScriptPromise simulateNotificationsStarted(ScriptState*, String gattResult); |
| 32 ScriptPromise simulateNotificationsStopped(ScriptState*, String gattResult); |
| 33 ScriptPromise simulateNotification(ScriptState*, const FakeNotificationOptions
& options); |
| 34 ScriptPromise addFakeDescriptor(ScriptState*, const FakeRemoteGATTDescriptorOp
tions& options); |
| 35 ScriptPromise removeFakeDescriptor(ScriptState*, FakeRemoteGATTDescriptor* des
criptor); |
| 36 ScriptPromise getReadCallsCount(ScriptState*); |
| 37 ScriptPromise getWriteWithResponseCallsCount(ScriptState*); |
| 38 ScriptPromise getWriteWithoutResponseCallsCount(ScriptState*); |
| 39 ScriptPromise getStartNotificationsCallsCount(ScriptState*); |
| 40 ScriptPromise getStopNotificationsCallsCount(ScriptState*); |
| 41 |
| 42 DECLARE_VIRTUAL_TRACE(); |
| 43 |
| 44 private: |
| 45 FakeRemoteGATTCharacteristic(); |
| 46 HeapHashSet<Member<FakeRemoteGATTDescriptor>> m_descriptors; |
| 47 |
| 48 }; |
| 49 |
| 50 } // namespace blink |
| 51 #endif |
OLD | NEW |