OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | |
10 | |
9 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" | 11 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" |
12 #include "chromeos/dbus/bluetooth_out_of_band_client.h" | |
10 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
11 | 14 |
12 namespace chromeos { | 15 namespace chromeos { |
13 | 16 |
14 class MockBluetoothAdapter : public BluetoothAdapter { | 17 class MockBluetoothAdapter : public BluetoothAdapter { |
15 public: | 18 public: |
16 MockBluetoothAdapter(); | 19 MockBluetoothAdapter(); |
17 virtual ~MockBluetoothAdapter(); | 20 virtual ~MockBluetoothAdapter(); |
18 | 21 |
19 MOCK_CONST_METHOD0(IsPresent, bool()); | 22 MOCK_CONST_METHOD0(IsPresent, bool()); |
20 MOCK_CONST_METHOD0(IsPowered, bool()); | 23 MOCK_CONST_METHOD0(IsPowered, bool()); |
24 MOCK_CONST_METHOD0(GetDevices, ConstDeviceList()); | |
25 MOCK_METHOD2(ClearOutOfBandPairingData, void(const std::string& address, | |
26 const ResultCallback& callback)); | |
21 | 27 |
22 MOCK_CONST_METHOD0(GetDevices, ConstDeviceList()); | 28 // Return whatever data was set with SetLocalOutOfBandPairingData. |
29 virtual void ReadLocalOutOfBandPairingData( | |
30 const BluetoothOutOfBandClient::DataCallback& callback) const; | |
31 | |
32 // Ownership of |data| remains with the caller. | |
33 void SetLocalOutOfBandPairingData(BluetoothOutOfBandPairingData* data); | |
satorux1
2012/06/14 16:07:55
Can you go with a regular MOCK_METHOD? I think it'
bryeung
2012/06/14 17:56:04
It's a pain to deal with returning data to callbac
| |
34 | |
35 private: | |
36 const BluetoothOutOfBandPairingData* local_oob_data_; | |
23 }; | 37 }; |
24 | 38 |
25 } // namespace chromeos | 39 } // namespace chromeos |
26 | 40 |
27 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ | 41 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |