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

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

Issue 1697873002: bluetooth: Test Web Bluetooth getCharacteristic calls against blacklist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-blacklist-integration-
Patch Set: addressed ortuno's comments Created 4 years, 10 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // - Heart Rate Service - Characteristics as described in 206 // - Heart Rate Service - Characteristics as described in
207 // GetHeartRateService. 207 // GetHeartRateService.
208 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> 208 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
209 GetHeartRateAdapter(); 209 GetHeartRateAdapter();
210 210
211 // |HeartRateAndHIDAdapter| 211 // |HeartRateAndHIDAdapter|
212 // Inherits from |EmptyAdapter| 212 // Inherits from |EmptyAdapter|
213 // Internal Structure: 213 // Internal Structure:
214 // - |ConnectableDevice|(adapter, "Heart Rate And HID Device", uuids) 214 // - |ConnectableDevice|(adapter, "Heart Rate And HID Device", uuids)
215 // - UUIDs: 215 // - UUIDs:
216 // - Device Information UUID (0x180a)
216 // - Generic Access UUID (0x1800) 217 // - Generic Access UUID (0x1800)
217 // - Heart Rate UUID (0x180d) 218 // - Heart Rate UUID (0x180d)
218 // - Human Interface Device UUID (0x1812) (a blacklisted service) 219 // - Human Interface Device UUID (0x1812) (a blacklisted service)
219 // - Services: 220 // - Services:
221 // - Device Information Service - Characteristics as described in
ortuno 2016/02/24 23:08:17 Ah. I ordered these by UUID, but it looks alphabet
scheib 2016/02/24 23:38:52 Done.
222 // GetDeviceInformationService.
220 // - Generic Access Service - Characteristics as described in 223 // - Generic Access Service - Characteristics as described in
221 // GetGenericAccessService. 224 // GetGenericAccessService.
222 // - Heart Rate Service - Characteristics as described in 225 // - Heart Rate Service - Characteristics as described in
223 // GetHeartRateService. 226 // GetHeartRateService.
224 // - Human Interface Device Service - No characteristics needed 227 // - Human Interface Device Service - No characteristics needed
225 // because the service is blacklisted. 228 // because the service is blacklisted.
226 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> 229 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
227 GetHeartRateAndHIDAdapter(); 230 GetHeartRateAndHIDAdapter();
228 231
229 // |DelayedServicesDiscoveryAdapter| 232 // |DelayedServicesDiscoveryAdapter|
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 // - IsLocal: 452 // - IsLocal:
450 // Returns: false 453 // Returns: false
451 // - IsPrimary: 454 // - IsPrimary:
452 // Returns: true 455 // Returns: true
453 // - GetDevice: 456 // - GetDevice:
454 // Returns: device 457 // Returns: device
455 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> 458 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>>
456 GetBaseGATTService(device::MockBluetoothDevice* device, 459 GetBaseGATTService(device::MockBluetoothDevice* device,
457 const std::string& uuid); 460 const std::string& uuid);
458 461
462 // |GetDeviceInformationService|
463 // Internal Structure:
464 // - Characteristics:
465 // - Serial Number String: (a blacklisted characteristic)
466 // - Mock Functions:
467 // - Read: Fails test.
468 // - GetProperties: Returns
469 // BluetoothGattCharacteristic::PROPERTY_READ
470 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>>
471 GetDeviceInformationService(device::MockBluetoothDevice* device);
472
459 // |GenericAccessService| 473 // |GenericAccessService|
460 // Internal Structure: 474 // Internal Structure:
461 // - Characteristics: 475 // - Characteristics:
462 // - Device Name: 476 // - Device Name:
463 // - Mock Functions: 477 // - Mock Functions:
464 // - Read: Calls success callback with device's name. 478 // - Read: Calls success callback with device's name.
465 // - Write: Calls success callback. 479 // - Write: Calls success callback.
466 // - GetProperties: Returns 480 // - GetProperties: Returns
467 // BluetoothGattCharacteristic::PROPERTY_READ | 481 // BluetoothGattCharacteristic::PROPERTY_READ |
468 // BluetoothGattCharacteristic::PROPERTY_WRITE 482 // BluetoothGattCharacteristic::PROPERTY_WRITE
469 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> 483 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>>
470 GetGenericAccessService(device::MockBluetoothAdapter* adapter, 484 GetGenericAccessService(device::MockBluetoothDevice* device);
471 device::MockBluetoothDevice* device);
472 485
473 // |HeartRateService| 486 // |HeartRateService|
474 // Internal Structure: 487 // Internal Structure:
475 // - Characteristics: 488 // - Characteristics:
476 // - Heart Rate Measurement (0x2a37) 489 // - Heart Rate Measurement (0x2a37)
477 // - Mock Functions: 490 // - Mock Functions:
478 // - StartNotifySession: Sets a timer to call 491 // - StartNotifySession: Sets a timer to call
479 // GattCharacteristicValueChanged every 10ms and calls 492 // GattCharacteristicValueChanged every 10ms and calls
480 // success callback with a 493 // success callback with a
481 // BaseGATTNotifySession(characteristic_instance_id) 494 // BaseGATTNotifySession(characteristic_instance_id)
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 585
573 // Function to turn an integer into an MAC address of the form 586 // Function to turn an integer into an MAC address of the form
574 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) 587 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef)
575 // returns "00:00:DE:AD:BE:EF". 588 // returns "00:00:DE:AD:BE:EF".
576 static std::string makeMACAddress(uint64_t addr); 589 static std::string makeMACAddress(uint64_t addr);
577 }; 590 };
578 591
579 } // namespace content 592 } // namespace content
580 593
581 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_ 594 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698