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

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

Issue 1991063002: Implement the gattserverdisconnected event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rename-web-bluetooth-device
Patch Set: Skip the new tests on Mac, where getCharacteristic isn't implemented yet. Created 4 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 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.

Powered by Google App Engine
This is Rietveld 408576698