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

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

Issue 1876753004: bluetooth: Check if device name is null before trying to convert (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Address scheib's comments Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_BLUETOOTH_TEST_H_ 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Create a fake Low Energy device and discover it. 89 // Create a fake Low Energy device and discover it.
90 // |device_ordinal| selects between multiple fake device data sets to produce: 90 // |device_ordinal| selects between multiple fake device data sets to produce:
91 // 1: kTestDeviceName with advertised UUIDs kTestUUIDGenericAccess, 91 // 1: kTestDeviceName with advertised UUIDs kTestUUIDGenericAccess,
92 // kTestUUIDGenericAttribute and address kTestDeviceAddress1. 92 // kTestUUIDGenericAttribute and address kTestDeviceAddress1.
93 // 2: kTestDeviceName with advertised UUIDs kTestUUIDImmediateAlert, 93 // 2: kTestDeviceName with advertised UUIDs kTestUUIDImmediateAlert,
94 // kTestUUIDLinkLoss and address kTestDeviceAddress1. 94 // kTestUUIDLinkLoss and address kTestDeviceAddress1.
95 // 3: kTestDeviceNameEmpty with no advertised UUIDs and address 95 // 3: kTestDeviceNameEmpty with no advertised UUIDs and address
96 // kTestDeviceAddress1. 96 // kTestDeviceAddress1.
97 // 4: kTestDeviceNameEmpty with no advertised UUIDs and address 97 // 4: kTestDeviceNameEmpty with no advertised UUIDs and address
98 // kTestDeviceAddress2. 98 // kTestDeviceAddress2.
99 // 5: Device with no name, with no advertised UUIDs and address
100 // kTestDeviceAddress1.
99 virtual BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal); 101 virtual BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal);
100 102
101 // Simulates success of implementation details of CreateGattConnection. 103 // Simulates success of implementation details of CreateGattConnection.
102 virtual void SimulateGattConnection(BluetoothDevice* device) {} 104 virtual void SimulateGattConnection(BluetoothDevice* device) {}
103 105
104 // Simulates failure of CreateGattConnection with the given error code. 106 // Simulates failure of CreateGattConnection with the given error code.
105 virtual void SimulateGattConnectionError(BluetoothDevice* device, 107 virtual void SimulateGattConnectionError(BluetoothDevice* device,
106 BluetoothDevice::ConnectErrorCode) {} 108 BluetoothDevice::ConnectErrorCode) {}
107 109
108 // Simulates GattConnection disconnecting. 110 // Simulates GattConnection disconnecting.
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 int actual_error_callback_calls_ = 0; 320 int actual_error_callback_calls_ = 0;
319 bool unexpected_success_callback_ = false; 321 bool unexpected_success_callback_ = false;
320 bool unexpected_error_callback_ = false; 322 bool unexpected_error_callback_ = false;
321 323
322 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; 324 base::WeakPtrFactory<BluetoothTestBase> weak_factory_;
323 }; 325 };
324 326
325 } // namespace device 327 } // namespace device
326 328
327 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 329 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698