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 FakeLEPeripheral_h |
| 6 #define FakeLEPeripheral_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "modules/bluetooth/FakeRemoteGATTService.h" |
| 11 #include "platform/heap/Handle.h" |
| 12 #include "platform/heap/Heap.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class FakeRemoteGATTServiceOptions; |
| 17 |
| 18 class FakeLEPeripheral : public GarbageCollected<FakeLEPeripheral>, |
| 19 public ScriptWrappable { |
| 20 DEFINE_WRAPPERTYPEINFO(); |
| 21 |
| 22 public: |
| 23 static FakeLEPeripheral* create() { return new FakeLEPeripheral(); } |
| 24 |
| 25 ScriptPromise simulateGATTConnection(ScriptState*, String connectionResult); |
| 26 ScriptPromise simulateGATTDiscoveryComplete(ScriptState*); |
| 27 ScriptPromise simulateGATTDiscoveryError(ScriptState*); |
| 28 |
| 29 ScriptPromise addFakeService(ScriptState*, const FakeRemoteGATTServiceOptions&
options); |
| 30 ScriptPromise removeFakeService(ScriptState*, FakeRemoteGATTService* service); |
| 31 |
| 32 DECLARE_VIRTUAL_TRACE(); |
| 33 |
| 34 private: |
| 35 FakeLEPeripheral(); |
| 36 |
| 37 HeapHashSet<Member<FakeRemoteGATTService>> m_services; |
| 38 |
| 39 }; |
| 40 |
| 41 } // namespace blink |
| 42 #endif |
OLD | NEW |