Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/FakeBluetooth.cpp

Issue 2716263002: DO NOT SUBMIT. Renderer side of Bluetooth Test API in blink C++ (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 #include "modules/bluetooth/FakeBluetooth.h"
6
7 #include "bindings/core/v8/ScriptPromise.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/DOMException.h"
10 #include "modules/bluetooth/FakeLECentralManager.h"
11 #include "modules/bluetooth/FakeBluetoothChooser.h"
12
13 namespace blink {
14
15 FakeBluetooth::FakeBluetooth() { }
16
17 ScriptPromise FakeBluetooth::setLEAvailability(ScriptState* scriptState,
18 bool availability) {
19 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
20 resolver->resolve();
21 return resolver->promise();
22 }
23
24 ScriptPromise FakeBluetooth::simulateFakeCentral(ScriptState* scriptState,
25 const FakeCentralOptions& optio ns) {
26 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
27 ScriptPromise promise = resolver->promise();
28 resolver->resolve(FakeLECentralManager::create());
29 return promise;
30 }
31
32 ScriptPromise FakeBluetooth::setBluetoothManualChooser(ScriptState* scriptState) {
33 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
34 ScriptPromise promise = resolver->promise();
35 resolver->resolve(FakeBluetoothChooser::create());
36 return promise;
37 }
38
39 DEFINE_TRACE(FakeBluetooth) {
40 }
41
42 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698