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

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

Issue 2381493005: Add bluetooth device type icons on MD system tray. (Closed)
Patch Set: Move BluetoothDeviceType to device/bluetooth/bluetooth_common.h Created 4 years, 2 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 #include "device/bluetooth/test/mock_bluetooth_device.h" 5 #include "device/bluetooth/test/mock_bluetooth_device.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 25 matching lines...) Expand all
36 .WillByDefault(testing::Return(0)); 36 .WillByDefault(testing::Return(0));
37 ON_CALL(*this, GetProductID()) 37 ON_CALL(*this, GetProductID())
38 .WillByDefault(testing::Return(0)); 38 .WillByDefault(testing::Return(0));
39 ON_CALL(*this, GetDeviceID()) 39 ON_CALL(*this, GetDeviceID())
40 .WillByDefault(testing::Return(0)); 40 .WillByDefault(testing::Return(0));
41 ON_CALL(*this, GetName()).WillByDefault(testing::Return(name_)); 41 ON_CALL(*this, GetName()).WillByDefault(testing::Return(name_));
42 ON_CALL(*this, GetNameForDisplay()) 42 ON_CALL(*this, GetNameForDisplay())
43 .WillByDefault(testing::Return( 43 .WillByDefault(testing::Return(
44 base::UTF8ToUTF16(name_ ? name_.value() : "Unnamed Device"))); 44 base::UTF8ToUTF16(name_ ? name_.value() : "Unnamed Device")));
45 ON_CALL(*this, GetDeviceType()) 45 ON_CALL(*this, GetDeviceType())
46 .WillByDefault(testing::Return(DEVICE_UNKNOWN)); 46 .WillByDefault(testing::Return(BluetoothDeviceType::UNKNOWN));
47 ON_CALL(*this, IsPaired()) 47 ON_CALL(*this, IsPaired())
48 .WillByDefault(testing::Return(paired)); 48 .WillByDefault(testing::Return(paired));
49 ON_CALL(*this, IsConnected()) 49 ON_CALL(*this, IsConnected())
50 .WillByDefault(testing::ReturnPointee(&connected_)); 50 .WillByDefault(testing::ReturnPointee(&connected_));
51 ON_CALL(*this, IsGattConnected()) 51 ON_CALL(*this, IsGattConnected())
52 .WillByDefault(testing::ReturnPointee(&connected_)); 52 .WillByDefault(testing::ReturnPointee(&connected_));
53 ON_CALL(*this, IsConnectable()) 53 ON_CALL(*this, IsConnectable())
54 .WillByDefault(testing::Return(false)); 54 .WillByDefault(testing::Return(false));
55 ON_CALL(*this, IsConnecting()) 55 ON_CALL(*this, IsConnecting())
56 .WillByDefault(testing::Return(false)); 56 .WillByDefault(testing::Return(false));
(...skipping 25 matching lines...) Expand all
82 BluetoothRemoteGattService* MockBluetoothDevice::GetMockService( 82 BluetoothRemoteGattService* MockBluetoothDevice::GetMockService(
83 const std::string& identifier) const { 83 const std::string& identifier) const {
84 for (BluetoothRemoteGattService* service : mock_services_) { 84 for (BluetoothRemoteGattService* service : mock_services_) {
85 if (service->GetIdentifier() == identifier) 85 if (service->GetIdentifier() == identifier)
86 return service; 86 return service;
87 } 87 }
88 return nullptr; 88 return nullptr;
89 } 89 }
90 90
91 } // namespace device 91 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698