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

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

Issue 1897873003: bluetooth: Check if device name is null before trying to convert (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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
« no previous file with comments | « device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // Create a fake Low Energy device and discover it. 87 // Create a fake Low Energy device and discover it.
88 // |device_ordinal| selects between multiple fake device data sets to produce: 88 // |device_ordinal| selects between multiple fake device data sets to produce:
89 // 1: kTestDeviceName with advertised UUIDs kTestUUIDGenericAccess, 89 // 1: kTestDeviceName with advertised UUIDs kTestUUIDGenericAccess,
90 // kTestUUIDGenericAttribute and address kTestDeviceAddress1. 90 // kTestUUIDGenericAttribute and address kTestDeviceAddress1.
91 // 2: kTestDeviceName with advertised UUIDs kTestUUIDImmediateAlert, 91 // 2: kTestDeviceName with advertised UUIDs kTestUUIDImmediateAlert,
92 // kTestUUIDLinkLoss and address kTestDeviceAddress1. 92 // kTestUUIDLinkLoss and address kTestDeviceAddress1.
93 // 3: kTestDeviceNameEmpty with no advertised UUIDs and address 93 // 3: kTestDeviceNameEmpty with no advertised UUIDs and address
94 // kTestDeviceAddress1. 94 // kTestDeviceAddress1.
95 // 4: kTestDeviceNameEmpty with no advertised UUIDs and address 95 // 4: kTestDeviceNameEmpty with no advertised UUIDs and address
96 // kTestDeviceAddress2. 96 // kTestDeviceAddress2.
97 // 5: Device with no name, with no advertised UUIDs and address
98 // kTestDeviceAddress1.
97 virtual BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal); 99 virtual BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal);
98 100
99 // Simulates success of implementation details of CreateGattConnection. 101 // Simulates success of implementation details of CreateGattConnection.
100 virtual void SimulateGattConnection(BluetoothDevice* device) {} 102 virtual void SimulateGattConnection(BluetoothDevice* device) {}
101 103
102 // Simulates failure of CreateGattConnection with the given error code. 104 // Simulates failure of CreateGattConnection with the given error code.
103 virtual void SimulateGattConnectionError(BluetoothDevice* device, 105 virtual void SimulateGattConnectionError(BluetoothDevice* device,
104 BluetoothDevice::ConnectErrorCode) {} 106 BluetoothDevice::ConnectErrorCode) {}
105 107
106 // Simulates GattConnection disconnecting. 108 // Simulates GattConnection disconnecting.
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 int actual_error_callback_calls_ = 0; 317 int actual_error_callback_calls_ = 0;
316 bool unexpected_success_callback_ = false; 318 bool unexpected_success_callback_ = false;
317 bool unexpected_error_callback_ = false; 319 bool unexpected_error_callback_ = false;
318 320
319 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; 321 base::WeakPtrFactory<BluetoothTestBase> weak_factory_;
320 }; 322 };
321 323
322 } // namespace device 324 } // namespace device
323 325
324 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 326 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
OLDNEW
« no previous file with comments | « device/bluetooth/test/android/java/src/org/chromium/device/bluetooth/Fakes.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698