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

Side by Side Diff: device/bluetooth/test/mock_bluetooth_device.h

Issue 13416005: Bluetooth: clean up BluetoothDevice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More win visible fixes Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
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 DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ 5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_
6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ 6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/string16.h" 10 #include "base/string16.h"
11 #include "device/bluetooth/bluetooth_device.h" 11 #include "device/bluetooth/bluetooth_device.h"
12 #include "device/bluetooth/bluetooth_out_of_band_pairing_data.h" 12 #include "device/bluetooth/bluetooth_out_of_band_pairing_data.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 14
15 namespace device { 15 namespace device {
16 16
17 class MockBluetoothAdapter; 17 class MockBluetoothAdapter;
18 18
19 class MockBluetoothDevice : public BluetoothDevice { 19 class MockBluetoothDevice : public BluetoothDevice {
20 public: 20 public:
21 MockBluetoothDevice(MockBluetoothAdapter* adapter, 21 MockBluetoothDevice(MockBluetoothAdapter* adapter,
22 uint32 bluetooth_class,
22 const std::string& name, 23 const std::string& name,
23 const std::string& address, 24 const std::string& address,
24 bool paired, 25 bool paired,
25 bool bonded,
26 bool connected); 26 bool connected);
27 virtual ~MockBluetoothDevice(); 27 virtual ~MockBluetoothDevice();
28 28
29 MOCK_CONST_METHOD0(address, const std::string&()); 29 MOCK_CONST_METHOD0(GetBluetoothClass, uint32());
30 MOCK_CONST_METHOD0(GetDeviceName, std::string());
31 MOCK_CONST_METHOD0(GetAddress, std::string());
30 MOCK_CONST_METHOD0(GetName, string16()); 32 MOCK_CONST_METHOD0(GetName, string16());
31 MOCK_CONST_METHOD0(GetDeviceType, BluetoothDevice::DeviceType()); 33 MOCK_CONST_METHOD0(GetDeviceType, BluetoothDevice::DeviceType());
32 MOCK_CONST_METHOD0(IsPaired, bool()); 34 MOCK_CONST_METHOD0(IsPaired, bool());
33 MOCK_CONST_METHOD0(IsBonded, bool());
34 MOCK_CONST_METHOD0(IsConnected, bool()); 35 MOCK_CONST_METHOD0(IsConnected, bool());
35 MOCK_CONST_METHOD0(GetServices, const ServiceList&()); 36 MOCK_CONST_METHOD0(IsConnectable, bool());
37 MOCK_CONST_METHOD0(IsConnecting, bool());
38 MOCK_CONST_METHOD0(GetServices, ServiceList());
36 MOCK_METHOD2(GetServiceRecords, 39 MOCK_METHOD2(GetServiceRecords,
37 void(const BluetoothDevice::ServiceRecordsCallback&, 40 void(const BluetoothDevice::ServiceRecordsCallback&,
38 const BluetoothDevice::ErrorCallback&)); 41 const BluetoothDevice::ErrorCallback&));
39 MOCK_CONST_METHOD1(ProvidesServiceWithUUID, bool(const std::string&)); 42 MOCK_CONST_METHOD1(ProvidesServiceWithUUID, bool(const std::string&));
40 MOCK_METHOD2(ProvidesServiceWithName, 43 MOCK_METHOD2(ProvidesServiceWithName,
41 void(const std::string&, 44 void(const std::string&,
42 const BluetoothDevice::ProvidesServiceCallback&)); 45 const BluetoothDevice::ProvidesServiceCallback&));
43 MOCK_CONST_METHOD0(ExpectingPinCode, bool()); 46 MOCK_CONST_METHOD0(ExpectingPinCode, bool());
44 MOCK_CONST_METHOD0(ExpectingPasskey, bool()); 47 MOCK_CONST_METHOD0(ExpectingPasskey, bool());
45 MOCK_CONST_METHOD0(ExpectingConfirmation, bool()); 48 MOCK_CONST_METHOD0(ExpectingConfirmation, bool());
(...skipping 17 matching lines...) Expand all
63 66
64 MOCK_METHOD3(SetOutOfBandPairingData, 67 MOCK_METHOD3(SetOutOfBandPairingData,
65 void(const BluetoothOutOfBandPairingData& data, 68 void(const BluetoothOutOfBandPairingData& data,
66 const base::Closure& callback, 69 const base::Closure& callback,
67 const BluetoothDevice::ErrorCallback& error_callback)); 70 const BluetoothDevice::ErrorCallback& error_callback));
68 MOCK_METHOD2(ClearOutOfBandPairingData, 71 MOCK_METHOD2(ClearOutOfBandPairingData,
69 void(const base::Closure& callback, 72 void(const base::Closure& callback,
70 const BluetoothDevice::ErrorCallback& error_callback)); 73 const BluetoothDevice::ErrorCallback& error_callback));
71 74
72 private: 75 private:
73 string16 name_; 76 uint32 bluetooth_class_;
77 std::string name_;
74 std::string address_; 78 std::string address_;
75 BluetoothDevice::ServiceList service_list_; 79 BluetoothDevice::ServiceList service_list_;
76 }; 80 };
77 81
78 } // namespace device 82 } // namespace device
79 83
80 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ 84 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_
OLDNEW
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_adapter.h ('k') | device/bluetooth/test/mock_bluetooth_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698