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

Unified Diff: third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js

Issue 2867713008: bluetooth: Implement known_service_uuids for Peripherals. (Closed)
Patch Set: rebase Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
diff --git a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
index 08901e571c71394ea2dcdd3f8f1e8e23283ad9cb..97919a8691d3bcc0d269fe6a4832f239646c09ce 100644
--- a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
+++ b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
@@ -423,10 +423,27 @@ function generateRequestDeviceArgsWithServices(services = ['heart_rate']) {
}];
}
-function setUpPreconnectedDevice({address = '00:00:00:00:00:00', name}) {
+function setUpPreconnectedDevice({
+ address = '00:00:00:00:00:00', name = 'LE Device', knownServiceUUIDs = []}) {
return navigator.bluetooth.test.simulateCentral({state: 'powered-on'})
.then(fake_central => fake_central.simulatePreconnectedPeripheral({
address: address,
- name: name
+ name: name,
+ knownServiceUUIDs: knownServiceUUIDs,
}));
}
+
+function setUpHealthThermometerAndHeartRateDevices() {
+ return navigator.bluetooth.test.simulateCentral({state: 'powered-on'})
+ .then(fake_central => Promise.all([
+ fake_central.simulatePreconnectedPeripheral({
+ address: '09:09:09:09:09:09',
+ name: 'Health Thermometer',
+ knownServiceUUIDs: ['generic_access', 'health_thermometer'],
+ }),
+ fake_central.simulatePreconnectedPeripheral({
+ address: '08:08:08:08:08:08',
+ name: 'Heart Rate',
+ knownServiceUUIDs: ['generic_access', 'heart_rate'],
+ })]));
+}

Powered by Google App Engine
This is Rietveld 408576698