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

Unified Diff: Source/modules/bluetooth/testing/BluetoothMock.h

Issue 650613005: bluetooth: Initial WebBluetooth & WebBluetoothError. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Abandoned initial approach implementing BluetoothMock in Blink. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/bluetooth/testing/BluetoothMock.h
diff --git a/Source/modules/bluetooth/testing/BluetoothMock.h b/Source/modules/bluetooth/testing/BluetoothMock.h
new file mode 100644
index 0000000000000000000000000000000000000000..880f45327cf4991d41775c5f5a801dde65ccb96e
--- /dev/null
+++ b/Source/modules/bluetooth/testing/BluetoothMock.h
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BluetoothMock_h
+#define BluetoothMock_h
+
+#include "platform/heap/Heap.h"
+#include "platform/heap/Visitor.h"
+#include "public/platform/WebBluetooth.h"
+#include "public/platform/WebBluetoothError.h"
+
+namespace blink {
+
+class BluetoothMock final
+ : public GarbageCollectedFinalized<BluetoothMock>
+ , public WebBluetooth {
+public:
+ BluetoothMock();
+
+ void bluetoothRequestDeviceWillReject(WebBluetoothError::ErrorType);
+
+ void trace(Visitor*) { }
+
+ // WebBluetooth implementation:
+ virtual void requestDevice(WebBluetoothRequestDeviceCallbacks*) override;
+
+private:
+ bool m_bluetoothRequestDeviceWillReject;
+ WebBluetoothError::ErrorType m_bluetoothRequestDeviceRejectType;
+};
+
+} // namespace blink
+
+#endif // BluetoothMock_h

Powered by Google App Engine
This is Rietveld 408576698