| 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 3a9f8ee5cbde3ee831626f21b89afec7b1f6858c..fdde3c64b8a26f8ece55911649083827945a8419 100644
|
| --- a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
|
| +++ b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
|
| @@ -234,7 +234,10 @@ function eventPromise(target, type, options) {
|
| // reject if the event is fired before |object|.|func|() resolves.
|
| // Returns a promise that fulfills with the result of |object|.|func()|
|
| // and |event.target.value| of each of the other promises.
|
| -function assert_event_fires_after_promise(object, func, event, num_listeners) {
|
| +// If |ignore_event_promise_order| is set true, this function will ignore
|
| +// the relative order of the event and the promise; otherwise it will assert
|
| +// the event is triggered after the promise is resolved.
|
| +function assert_event_fires_after_promise(object, func, event, num_listeners, ignore_event_promise_order) {
|
| num_listeners = num_listeners !== undefined ? num_listeners : 1;
|
|
|
| if (object[func] === undefined) {
|
| @@ -246,7 +249,7 @@ function assert_event_fires_after_promise(object, func, event, num_listeners) {
|
| event_promises.push(new Promise((resolve, reject) => {
|
| let event_listener = (e) => {
|
| object.removeEventListener(event, event_listener);
|
| - if (should_resolve) {
|
| + if (should_resolve || ignore_event_promise_order) {
|
| resolve(e.target.value);
|
| } else {
|
| reject(event + ' was triggered before the promise resolved.');
|
|
|