| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
| 6 #include "device/bluetooth/bluetooth_adapter.h" | 6 #include "device/bluetooth/bluetooth_adapter.h" |
| 7 #include "device/bluetooth/bluetooth_device.h" | 7 #include "device/bluetooth/bluetooth_device.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 using device::BluetoothAdapter; | 10 using device::BluetoothAdapter; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 virtual void SetDiscoverable( | 62 virtual void SetDiscoverable( |
| 63 bool discoverable, | 63 bool discoverable, |
| 64 const base::Closure& callback, | 64 const base::Closure& callback, |
| 65 const ErrorCallback& error_callback) OVERRIDE { | 65 const ErrorCallback& error_callback) OVERRIDE { |
| 66 } | 66 } |
| 67 | 67 |
| 68 virtual bool IsDiscovering() const OVERRIDE { | 68 virtual bool IsDiscovering() const OVERRIDE { |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 | 71 |
| 72 virtual void StartDiscovering( | 72 virtual void StartDiscoverySession( |
| 73 const base::Closure& callback, | 73 const DiscoverySessionCallback& callback, |
| 74 const ErrorCallback& error_callback) OVERRIDE { | 74 const ErrorCallback& error_callback) OVERRIDE { |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual void StopDiscovering( | 77 virtual void ReadLocalOutOfBandPairingData( |
| 78 const base::Closure& callback, | 78 const BluetoothAdapter::BluetoothOutOfBandPairingDataCallback& callback, |
| 79 const ErrorCallback& error_callback) OVERRIDE { | 79 const ErrorCallback& error_callback) OVERRIDE { |
| 80 } | 80 } |
| 81 | 81 |
| 82 protected: |
| 83 virtual ~TestBluetoothAdapter() {} |
| 84 |
| 82 virtual void AddDiscoverySession( | 85 virtual void AddDiscoverySession( |
| 83 const base::Closure& callback, | 86 const base::Closure& callback, |
| 84 const ErrorCallback& error_callback) OVERRIDE { | 87 const ErrorCallback& error_callback) OVERRIDE { |
| 85 } | 88 } |
| 86 | 89 |
| 87 virtual void RemoveDiscoverySession( | 90 virtual void RemoveDiscoverySession( |
| 88 const base::Closure& callback, | 91 const base::Closure& callback, |
| 89 const ErrorCallback& error_callback) OVERRIDE { | 92 const ErrorCallback& error_callback) OVERRIDE { |
| 90 } | 93 } |
| 91 | 94 |
| 92 virtual void ReadLocalOutOfBandPairingData( | |
| 93 const BluetoothAdapter::BluetoothOutOfBandPairingDataCallback& callback, | |
| 94 const ErrorCallback& error_callback) OVERRIDE { | |
| 95 } | |
| 96 | |
| 97 protected: | |
| 98 virtual ~TestBluetoothAdapter() {} | |
| 99 | |
| 100 virtual void RemovePairingDelegateInternal( | 95 virtual void RemovePairingDelegateInternal( |
| 101 BluetoothDevice::PairingDelegate* pairing_delegate) OVERRIDE { | 96 BluetoothDevice::PairingDelegate* pairing_delegate) OVERRIDE { |
| 102 } | 97 } |
| 103 }; | 98 }; |
| 104 | 99 |
| 105 class TestPairingDelegate : public BluetoothDevice::PairingDelegate { | 100 class TestPairingDelegate : public BluetoothDevice::PairingDelegate { |
| 106 public: | 101 public: |
| 107 virtual void RequestPinCode(BluetoothDevice* device) OVERRIDE {} | 102 virtual void RequestPinCode(BluetoothDevice* device) OVERRIDE {} |
| 108 virtual void RequestPasskey(BluetoothDevice* device) OVERRIDE {} | 103 virtual void RequestPasskey(BluetoothDevice* device) OVERRIDE {} |
| 109 virtual void DisplayPinCode(BluetoothDevice* device, | 104 virtual void DisplayPinCode(BluetoothDevice* device, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 TestPairingDelegate delegate; | 174 TestPairingDelegate delegate; |
| 180 | 175 |
| 181 adapter->AddPairingDelegate(&delegate, | 176 adapter->AddPairingDelegate(&delegate, |
| 182 BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_LOW); | 177 BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_LOW); |
| 183 adapter->RemovePairingDelegate(&delegate); | 178 adapter->RemovePairingDelegate(&delegate); |
| 184 | 179 |
| 185 EXPECT_TRUE(adapter->DefaultPairingDelegate() == NULL); | 180 EXPECT_TRUE(adapter->DefaultPairingDelegate() == NULL); |
| 186 } | 181 } |
| 187 | 182 |
| 188 } // namespace device | 183 } // namespace device |
| OLD | NEW |