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

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

Issue 812673002: bluetooth: BluetoothAdapterDeleter used to control BluetoothAdapter destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: respond to armansito & fix Mock Created 6 years 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_ADAPTER_H_ 5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_
6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ 6 #define DEVICE_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"
(...skipping 15 matching lines...) Expand all
26 MOCK_METHOD2(AdapterDiscoveringChanged, void(BluetoothAdapter*, bool)); 26 MOCK_METHOD2(AdapterDiscoveringChanged, void(BluetoothAdapter*, bool));
27 MOCK_METHOD2(DeviceAdded, void(BluetoothAdapter*, BluetoothDevice*)); 27 MOCK_METHOD2(DeviceAdded, void(BluetoothAdapter*, BluetoothDevice*));
28 MOCK_METHOD2(DeviceChanged, void(BluetoothAdapter*, BluetoothDevice*)); 28 MOCK_METHOD2(DeviceChanged, void(BluetoothAdapter*, BluetoothDevice*));
29 MOCK_METHOD2(DeviceRemoved, void(BluetoothAdapter*, BluetoothDevice*)); 29 MOCK_METHOD2(DeviceRemoved, void(BluetoothAdapter*, BluetoothDevice*));
30 }; 30 };
31 31
32 MockBluetoothAdapter(); 32 MockBluetoothAdapter();
33 33
34 virtual bool IsInitialized() const { return true; } 34 virtual bool IsInitialized() const { return true; }
35 35
36 MOCK_METHOD0(DeleteOnCorrectThread, void());
armansito 2014/12/16 22:17:18 Remove this, now that there's an actual implementa
scheib 2014/12/16 22:28:45 Done.
36 MOCK_METHOD1(AddObserver, void(BluetoothAdapter::Observer*)); 37 MOCK_METHOD1(AddObserver, void(BluetoothAdapter::Observer*));
37 MOCK_METHOD1(RemoveObserver, void(BluetoothAdapter::Observer*)); 38 MOCK_METHOD1(RemoveObserver, void(BluetoothAdapter::Observer*));
38 MOCK_CONST_METHOD0(GetAddress, std::string()); 39 MOCK_CONST_METHOD0(GetAddress, std::string());
39 MOCK_CONST_METHOD0(GetName, std::string()); 40 MOCK_CONST_METHOD0(GetName, std::string());
40 MOCK_METHOD3(SetName, 41 MOCK_METHOD3(SetName,
41 void(const std::string& name, 42 void(const std::string& name,
42 const base::Closure& callback, 43 const base::Closure& callback,
43 const ErrorCallback& error_callback)); 44 const ErrorCallback& error_callback));
44 MOCK_CONST_METHOD0(IsPresent, bool()); 45 MOCK_CONST_METHOD0(IsPresent, bool());
45 MOCK_CONST_METHOD0(IsPowered, bool()); 46 MOCK_CONST_METHOD0(IsPowered, bool());
(...skipping 25 matching lines...) Expand all
71 const ServiceOptions& options, 72 const ServiceOptions& options,
72 const CreateServiceCallback& callback, 73 const CreateServiceCallback& callback,
73 const CreateServiceErrorCallback& error_callback)); 74 const CreateServiceErrorCallback& error_callback));
74 MOCK_METHOD4(CreateL2capService, 75 MOCK_METHOD4(CreateL2capService,
75 void(const BluetoothUUID& uuid, 76 void(const BluetoothUUID& uuid,
76 const ServiceOptions& options, 77 const ServiceOptions& options,
77 const CreateServiceCallback& callback, 78 const CreateServiceCallback& callback,
78 const CreateServiceErrorCallback& error_callback)); 79 const CreateServiceErrorCallback& error_callback));
79 80
80 protected: 81 protected:
82 void DeleteOnCorrectThread() const override;
81 virtual void AddDiscoverySession(const base::Closure& callback, 83 virtual void AddDiscoverySession(const base::Closure& callback,
82 const ErrorCallback& error_callback); 84 const ErrorCallback& error_callback);
83 virtual void RemoveDiscoverySession(const base::Closure& callback, 85 virtual void RemoveDiscoverySession(const base::Closure& callback,
84 const ErrorCallback& error_callback); 86 const ErrorCallback& error_callback);
85 virtual ~MockBluetoothAdapter(); 87 virtual ~MockBluetoothAdapter();
86 88
87 MOCK_METHOD1(RemovePairingDelegateInternal, 89 MOCK_METHOD1(RemovePairingDelegateInternal,
88 void(BluetoothDevice::PairingDelegate* pairing_delegate)); 90 void(BluetoothDevice::PairingDelegate* pairing_delegate));
89 }; 91 };
90 92
91 } // namespace device 93 } // namespace device
92 94
93 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ 95 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_win.cc ('k') | device/bluetooth/test/mock_bluetooth_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698