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

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

Issue 1156573005: bluetooth: Browser-side implementation of getCharacteristic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-get-primary-service-initial
Patch Set: Fix histograms.xml and bad_messages.h merge conflict Created 5 years, 6 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
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/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const ConnectErrorCallback& error_callback)); 76 const ConnectErrorCallback& error_callback));
77 77
78 MOCK_METHOD2(StartConnectionMonitor, 78 MOCK_METHOD2(StartConnectionMonitor,
79 void(const base::Closure& callback, 79 void(const base::Closure& callback,
80 const BluetoothDevice::ErrorCallback& error_callback)); 80 const BluetoothDevice::ErrorCallback& error_callback));
81 81
82 MOCK_CONST_METHOD0(GetGattServices, std::vector<BluetoothGattService*>()); 82 MOCK_CONST_METHOD0(GetGattServices, std::vector<BluetoothGattService*>());
83 MOCK_CONST_METHOD1(GetGattService, BluetoothGattService*(const std::string&)); 83 MOCK_CONST_METHOD1(GetGattService, BluetoothGattService*(const std::string&));
84 84
85 // BluetoothDevice manages the lifetime of its BluetoothGATTServices. 85 // BluetoothDevice manages the lifetime of its BluetoothGATTServices.
86 // This methods takes ownership of the BluetoothGATTServices. This is only for 86 // This method takes ownership of the MockBluetoothGATTServices. This is only
87 // convenience as far as testing is concerned, and it's possible to write test 87 // for convenience as far as testing is concerned, and it's possible to write
88 // cases without using these functions. 88 // test cases without using these functions.
89 // Example: 89 // Example:
90 // ON_CALL(*mock_device, GetGattServices)) 90 // ON_CALL(*mock_device, GetGattServices))
91 // .WillByDefault(Invoke(*mock_device, 91 // .WillByDefault(Invoke(*mock_device,
92 // &MockBluetoothDevice::GetMockServices)); 92 // &MockBluetoothDevice::GetMockServices));
93 void AddMockService(scoped_ptr<MockBluetoothGattService> mock_device); 93 void AddMockService(scoped_ptr<MockBluetoothGattService> mock_device);
94 std::vector<BluetoothGattService*> GetMockServices() const; 94 std::vector<BluetoothGattService*> GetMockServices() const;
95 BluetoothGattService* GetMockService(const std::string& identifier) const;
95 96
96 private: 97 private:
97 uint32 bluetooth_class_; 98 uint32 bluetooth_class_;
98 std::string name_; 99 std::string name_;
99 std::string address_; 100 std::string address_;
100 BluetoothDevice::UUIDList uuids_; 101 BluetoothDevice::UUIDList uuids_;
101 102
102 ScopedVector<MockBluetoothGattService> mock_services_; 103 ScopedVector<MockBluetoothGattService> mock_services_;
103 }; 104 };
104 105
105 } // namespace device 106 } // namespace device
106 107
107 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ 108 #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