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

Side by Side Diff: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h

Issue 2014473002: bluetooth: Web Bluetooth can filter by empty device names, doesn't leak MACs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-GetNameOrEmpty-
Patch Set: Merge Created 4 years, 5 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 CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_ 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_
6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_ 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // - Generic Access UUID (0x1800) 175 // - Generic Access UUID (0x1800)
176 // - Heart Rate UUID (0x180d) 176 // - Heart Rate UUID (0x180d)
177 // - Services: 177 // - Services:
178 // - Generic Access Service - Characteristics as described in 178 // - Generic Access Service - Characteristics as described in
179 // GetGenericAccessService. 179 // GetGenericAccessService.
180 // - Heart Rate Service - Characteristics as described in 180 // - Heart Rate Service - Characteristics as described in
181 // GetHeartRateService. 181 // GetHeartRateService.
182 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> 182 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
183 GetHeartRateAdapter(); 183 GetHeartRateAdapter();
184 184
185 // |GetUnnamedHeartRateAdapter|
186 // Inherits from |EmptyAdapter|
187 // Internal Structure:
188 // - Heart Rate Device
189 // - UUIDs:
190 // - Generic Access UUID (0x1800)
191 // - Heart Rate UUID (0x180d)
192 // - Services:
193 // - Generic Access Service - Characteristics as described in
194 // GetGenericAccessService.
195 // - gap.device_name returns an empty string.
196 // - Heart Rate Service - Characteristics as described in
197 // GetHeartRateService.
198 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
199 GetUnnamedHeartRateAdapter();
200
185 // |TwoHeartRateServicesAdapter| 201 // |TwoHeartRateServicesAdapter|
186 // Inherits from |EmptyAdapter| 202 // Inherits from |EmptyAdapter|
187 // Internal Structure: 203 // Internal Structure:
188 // - Heart Rate Device 204 // - Heart Rate Device
189 // - UUIDs: 205 // - UUIDs:
190 // - Generic Access UUID (0x1800) 206 // - Generic Access UUID (0x1800)
191 // - Heart Rate UUID (0x180d) 207 // - Heart Rate UUID (0x180d)
192 // - Heart Rate UUID (0x180d) 208 // - Heart Rate UUID (0x180d)
193 // - Services: 209 // - Services:
194 // - Generic Access Service - Characteristics as described in 210 // - Generic Access Service - Characteristics as described in
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 444
429 // |HeartRateDevice| 445 // |HeartRateDevice|
430 // Inherits from |ConnectableDevice|(adapter, "Heart Rate Device", uuids) 446 // Inherits from |ConnectableDevice|(adapter, "Heart Rate Device", uuids)
431 // UUIDs added: 447 // UUIDs added:
432 // - Generic Access (0x1800) 448 // - Generic Access (0x1800)
433 // - Heart Rate UUID (0x180D) 449 // - Heart Rate UUID (0x180D)
434 // Services added: 450 // Services added:
435 // None. Each user of the HeartRateDevice is in charge of adding the 451 // None. Each user of the HeartRateDevice is in charge of adding the
436 // relevant services, characteristics and descriptors. 452 // relevant services, characteristics and descriptors.
437 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> 453 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>>
438 GetHeartRateDevice(device::MockBluetoothAdapter* adapter); 454 GetHeartRateDevice(device::MockBluetoothAdapter* adapter,
455 const std::string& device_name = "Heart Rate Device");
439 456
440 // Services 457 // Services
441 458
442 // |BaseGATTService|(identifier, device, uuid) 459 // |BaseGATTService|(identifier, device, uuid)
443 // Characteristics added: 460 // Characteristics added:
444 // None. 461 // None.
445 // Mock Functions: 462 // Mock Functions:
446 // - GetCharacteristics: 463 // - GetCharacteristics:
447 // Returns a list with all the characteristics added to the service 464 // Returns a list with all the characteristics added to the service
448 // - GetCharacteristic: 465 // - GetCharacteristic:
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 637
621 // Function to turn an integer into an MAC address of the form 638 // Function to turn an integer into an MAC address of the form
622 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) 639 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef)
623 // returns "00:00:DE:AD:BE:EF". 640 // returns "00:00:DE:AD:BE:EF".
624 static std::string makeMACAddress(uint64_t addr); 641 static std::string makeMACAddress(uint64_t addr);
625 }; 642 };
626 643
627 } // namespace content 644 } // namespace content
628 645
629 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_ 646 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698