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 6735a3b04e706217177533717911ac0baa13a87d..6b490383203546d1f3a1542091735dcb4a61d3a7 100644 |
--- a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js |
+++ b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js |
@@ -3,9 +3,12 @@ |
// Bluetooth UUID constants: |
// Services: |
var blacklist_test_service_uuid = "611c954a-263b-4f4a-aab6-01ddb953f985"; |
+var request_disconnection_service_uuid = "01d7d889-7451-419f-aeb8-d65e7b9277af"; |
// Characteristics: |
var blacklist_exclude_reads_characteristic_uuid = |
"bad1c9a2-9a5b-4015-8b60-1579bbbf2135"; |
+var request_disconnection_characteristic_uuid = |
+ "01d7d88a-7451-419f-aeb8-d65e7b9277af"; |
// Sometimes we need to test that using either the name, alias, or UUID |
// produces the same result. The following objects help us do that. |
@@ -216,6 +219,16 @@ function runGarbageCollection() |
}); |
} |
+function eventPromise(target, type, options) { |
+ return new Promise(resolve => { |
+ let wrapper = function(event) { |
+ target.removeEventListener(type, wrapper); |
+ resolve(event); |
+ }; |
+ target.addEventListener(type, wrapper, options); |
+ }); |
+} |
+ |
// Creates |num_listeners| promises. Each adds an event listener |
// to object. The promises resolve once the object fires |event| but |
// reject if the event is fired before |object|.|func|() resolves. |