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

Side by Side Diff: chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter.h

Issue 10899037: Refactoring bluetooth API code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing styles and tess. Created 8 years, 3 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 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 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" 11 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h"
12 #include "chrome/browser/chromeos/bluetooth/bluetooth_device.h" 12 #include "chrome/browser/chromeos/bluetooth/bluetooth_device.h"
13 #include "chromeos/dbus/bluetooth_out_of_band_client.h" 13 #include "chromeos/dbus/bluetooth_out_of_band_client.h"
14 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gmock/include/gmock/gmock.h"
15 15
16 namespace chromeos { 16 namespace chromeos {
17 17
18 class MockBluetoothAdapter : public BluetoothAdapter { 18 class MockBluetoothAdapter : public BluetoothAdapter {
19 public: 19 public:
20 class Observer : public BluetoothAdapter::Observer { 20 class Observer : public BluetoothAdapter::Observer {
21 public: 21 public:
22 Observer(); 22 Observer();
23 virtual ~Observer(); 23 virtual ~Observer();
24 24
25 MOCK_METHOD2(AdapterPresentChanged, void(BluetoothAdapter*, bool)); 25 MOCK_METHOD2(AdapterPresentChanged, void(BluetoothAdapter*, bool));
26 MOCK_METHOD2(AdapterPoweredChanged, void(BluetoothAdapter*, bool)); 26 MOCK_METHOD2(AdapterPoweredChanged, void(BluetoothAdapter*, bool));
27 MOCK_METHOD2(AdapterDiscoveringChanged, void(BluetoothAdapter *, bool)); 27 MOCK_METHOD2(AdapterDiscoveringChanged,
bryeung 2012/09/13 19:52:57 why did this get line-broken?
youngki 2012/09/17 21:53:02 Done.
28 MOCK_METHOD2(DeviceAdded, void(BluetoothAdapter *, BluetoothDevice *)); 28 void(BluetoothAdapter*, bool));
29 MOCK_METHOD2(DeviceChanged, void(BluetoothAdapter *, BluetoothDevice *)); 29 MOCK_METHOD2(DeviceAdded,
30 MOCK_METHOD2(DeviceRemoved, void(BluetoothAdapter *, BluetoothDevice *)); 30 void(BluetoothAdapter*, BluetoothDevice*));
31 MOCK_METHOD2(DeviceChanged,
32 void(BluetoothAdapter*, BluetoothDevice*));
33 MOCK_METHOD2(DeviceRemoved,
34 void(BluetoothAdapter*, BluetoothDevice*));
31 }; 35 };
32 36
33 MockBluetoothAdapter(const std::string& address, const std::string& name); 37 MockBluetoothAdapter(const std::string& address, const std::string& name);
34 38
39 MOCK_METHOD1(AddObserver, void(BluetoothAdapter::Observer*));
40 MOCK_METHOD1(RemoveObserver, void(BluetoothAdapter::Observer*));
41 MOCK_CONST_METHOD0(address, const std::string&());
42 MOCK_CONST_METHOD0(name, const std::string&());
35 MOCK_CONST_METHOD0(IsPresent, bool()); 43 MOCK_CONST_METHOD0(IsPresent, bool());
36 MOCK_CONST_METHOD0(IsPowered, bool()); 44 MOCK_CONST_METHOD0(IsPowered, bool());
45 MOCK_METHOD3(SetPowered,
46 void(bool discovering,
47 const base::Closure& callback,
48 const ErrorCallback& error_callback));
37 MOCK_CONST_METHOD0(IsDiscovering, bool()); 49 MOCK_CONST_METHOD0(IsDiscovering, bool());
38 MOCK_METHOD3(SetDiscovering, 50 MOCK_METHOD3(SetDiscovering,
39 void(bool discovering, 51 void(bool discovering,
40 const base::Closure& callback, 52 const base::Closure& callback,
41 const BluetoothAdapter::ErrorCallback& error_callback)); 53 const ErrorCallback& error_callback));
42 MOCK_CONST_METHOD0(GetDevices, ConstDeviceList()); 54 MOCK_METHOD0(GetDevices, BluetoothAdapter::DeviceList());
55 MOCK_CONST_METHOD0(GetDevices, BluetoothAdapter::ConstDeviceList());
43 MOCK_METHOD1(GetDevice, BluetoothDevice*(const std::string& address)); 56 MOCK_METHOD1(GetDevice, BluetoothDevice*(const std::string& address));
44 MOCK_CONST_METHOD1(GetDevice, 57 MOCK_CONST_METHOD1(GetDevice,
45 const BluetoothDevice*(const std::string& address)); 58 const BluetoothDevice*(const std::string& address));
46 MOCK_METHOD2( 59 MOCK_METHOD2(
47 ReadLocalOutOfBandPairingData, 60 ReadLocalOutOfBandPairingData,
48 void(const BluetoothAdapter::BluetoothOutOfBandPairingDataCallback& 61 void(const BluetoothOutOfBandPairingDataCallback& callback,
49 callback, 62 const ErrorCallback& error_callback));
50 const BluetoothAdapter::ErrorCallback& error_callback));
51 protected: 63 protected:
52 virtual ~MockBluetoothAdapter(); 64 virtual ~MockBluetoothAdapter();
53 }; 65 };
54 66
55 } // namespace chromeos 67 } // namespace chromeos
56 68
57 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ 69 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698