OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 "config.h" |
| 6 #include "InternalsBluetooth.h" |
| 7 |
| 8 #include "core/frame/Navigator.h" |
| 9 #include "core/testing/Internals.h" |
| 10 #include "modules/bluetooth/Bluetooth.h" |
| 11 #include "modules/bluetooth/NavigatorBluetooth.h" |
| 12 #include "modules/bluetooth/testing/BluetoothMock.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 void InternalsBluetooth::resetBluetoothMock(Internals&, Navigator* navigator) |
| 17 { |
| 18 NavigatorBluetooth::bluetooth(*navigator)->resetBluetoothMockForTesting(); |
| 19 } |
| 20 |
| 21 void InternalsBluetooth::bluetoothRequestDeviceWillReject(Internals&, Navigator*
navigator, const String& error) |
| 22 { |
| 23 BluetoothMock* mock = NavigatorBluetooth::bluetooth(*navigator)->getBluetoot
hMockForTesting(); |
| 24 if (error == "NotFoundError") |
| 25 mock->bluetoothRequestDeviceWillReject(WebBluetoothError::NotFoundError)
; |
| 26 else if (error == "SecurityError") |
| 27 mock->bluetoothRequestDeviceWillReject(WebBluetoothError::SecurityError)
; |
| 28 else |
| 29 ASSERT_NOT_REACHED(); |
| 30 } |
| 31 |
| 32 } // namespace blink |
| 33 |
OLD | NEW |