diff options
Diffstat (limited to 'testing/web-platform/tests/bluetooth/requestDevice/canonicalizeFilter/empty-manufacturerData-member.https.window.js')
-rw-r--r-- | testing/web-platform/tests/bluetooth/requestDevice/canonicalizeFilter/empty-manufacturerData-member.https.window.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/web-platform/tests/bluetooth/requestDevice/canonicalizeFilter/empty-manufacturerData-member.https.window.js b/testing/web-platform/tests/bluetooth/requestDevice/canonicalizeFilter/empty-manufacturerData-member.https.window.js new file mode 100644 index 0000000000..0996137f51 --- /dev/null +++ b/testing/web-platform/tests/bluetooth/requestDevice/canonicalizeFilter/empty-manufacturerData-member.https.window.js @@ -0,0 +1,35 @@ +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js +'use strict'; +const test_desc = 'requestDevice with empty manufacturerData. ' + + 'Should reject with TypeError.'; +const test_specs = [ + {filters: [{manufacturerData: []}]}, + {filters: [{manufacturerData: [], name: 'Name'}]}, + {filters: [{manufacturerData: [], services: ['heart_rate']}]}, + {filters: [{manufacturerData: [], name: 'Name', services: ['heart_rate']}]}, + {filters: [{manufacturerData: []}], optionalServices: ['heart_rate']}, { + filters: [{manufacturerData: [], name: 'Name'}], + optionalServices: ['heart_rate'] + }, + { + filters: [{manufacturerData: [], services: ['heart_rate']}], + optionalServices: ['heart_rate'] + }, + { + filters: [{manufacturerData: [], name: 'Name', services: ['heart_rate']}], + optionalServices: ['heart_rate'] + } +]; + +bluetooth_test((t) => { + let test_promises = Promise.resolve(); + test_specs.forEach(args => { + test_promises = test_promises.then( + () => promise_rejects_js( + t, TypeError, requestDeviceWithTrustedClick(args))); + }); + return test_promises; +}, test_desc);
\ No newline at end of file |