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

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: 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 GetHeartRateAdapter(); 206 GetHeartRateAdapter();
207 207
208 // |HeartRateAndHIDAdapter| 208 // |HeartRateAndHIDAdapter|
209 // Inherits from |EmptyAdapter| 209 // Inherits from |EmptyAdapter|
210 // Internal Structure: 210 // Internal Structure:
211 // - |ConnectableDevice|(adapter, "Heart Rate And HID Device", uuids) 211 // - |ConnectableDevice|(adapter, "Heart Rate And HID Device", uuids)
212 // - Advertised UUIDs: 212 // - Advertised UUIDs:
213 // - Heart Rate UUID (0x180d) 213 // - Heart Rate UUID (0x180d)
214 // - Human Interface Device UUID (0x1812) (a blacklisted service) 214 // - Human Interface Device UUID (0x1812) (a blacklisted service)
215 // - Services: 215 // - Services:
216 // - Device Information Service - Characteristics as described in
ortuno 2016/02/23 22:37:59 The services in the device should match the UUIDs
scheib 2016/02/24 19:51:29 Done.
217 // GetDeviceInformationService.
216 // - Generic Access Service - Characteristics as described in 218 // - Generic Access Service - Characteristics as described in
217 // GetGenericAccessService. 219 // GetGenericAccessService.
218 // - Heart Rate Service - Characteristics as described in 220 // - Heart Rate Service - Characteristics as described in
219 // GetHeartRateService. 221 // GetHeartRateService.
220 // - Human Interface Device Service - No characteristics needed 222 // - Human Interface Device Service - No characteristics needed
221 // because the service is blacklisted. 223 // because the service is blacklisted.
222 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> 224 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
223 GetHeartRateAndHIDAdapter(); 225 GetHeartRateAndHIDAdapter();
224 226
225 // |DelayedServicesDiscoveryAdapter| 227 // |DelayedServicesDiscoveryAdapter|
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 // - IsLocal: 446 // - IsLocal:
445 // Returns: false 447 // Returns: false
446 // - IsPrimary: 448 // - IsPrimary:
447 // Returns: true 449 // Returns: true
448 // - GetDevice: 450 // - GetDevice:
449 // Returns: device 451 // Returns: device
450 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> 452 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>>
451 GetBaseGATTService(device::MockBluetoothDevice* device, 453 GetBaseGATTService(device::MockBluetoothDevice* device,
452 const std::string& uuid); 454 const std::string& uuid);
453 455
456 // |GetDeviceInformationService|
457 // Internal Structure:
458 // - Characteristics:
459 // - Serial Number String: (a blacklisted characteristic)
460 // - Mock Functions:
461 // - Read: Fails test.
462 // - GetProperties: Returns
463 // BluetoothGattCharacteristic::PROPERTY_READ
464 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>>
465 GetDeviceInformationService(device::MockBluetoothDevice* device);
466
454 // |GenericAccessService| 467 // |GenericAccessService|
455 // Internal Structure: 468 // Internal Structure:
456 // - Characteristics: 469 // - Characteristics:
457 // - Device Name: 470 // - Device Name:
458 // - Mock Functions: 471 // - Mock Functions:
459 // - Read: Calls success callback with device's name. 472 // - Read: Calls success callback with device's name.
460 // - Write: Calls success callback. 473 // - Write: Calls success callback.
461 // - GetProperties: Returns 474 // - GetProperties: Returns
462 // BluetoothGattCharacteristic::PROPERTY_READ | 475 // BluetoothGattCharacteristic::PROPERTY_READ |
463 // BluetoothGattCharacteristic::PROPERTY_WRITE 476 // BluetoothGattCharacteristic::PROPERTY_WRITE
464 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> 477 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>>
465 GetGenericAccessService(device::MockBluetoothAdapter* adapter, 478 GetGenericAccessService(device::MockBluetoothDevice* device);
466 device::MockBluetoothDevice* device);
467 479
468 // |HeartRateService| 480 // |HeartRateService|
469 // Internal Structure: 481 // Internal Structure:
470 // - Characteristics: 482 // - Characteristics:
471 // - Heart Rate Measurement (0x2a37) 483 // - Heart Rate Measurement (0x2a37)
472 // - Mock Functions: 484 // - Mock Functions:
473 // - StartNotifySession: Sets a timer to call 485 // - StartNotifySession: Sets a timer to call
474 // GattCharacteristicValueChanged every 10ms and calls 486 // GattCharacteristicValueChanged every 10ms and calls
475 // success callback with a 487 // success callback with a
476 // BaseGATTNotifySession(characteristic_instance_id) 488 // BaseGATTNotifySession(characteristic_instance_id)
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 579
568 // Function to turn an integer into an MAC address of the form 580 // Function to turn an integer into an MAC address of the form
569 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) 581 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef)
570 // returns "00:00:DE:AD:BE:EF". 582 // returns "00:00:DE:AD:BE:EF".
571 static std::string makeMACAddress(uint64_t addr); 583 static std::string makeMACAddress(uint64_t addr);
572 }; 584 };
573 585
574 } // namespace content 586 } // namespace content
575 587
576 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_ 588 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698