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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice/filter-does-not-match.html

Issue 1910933002: bluetooth: Separate requestDevice tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo-gatt-connect
Patch Set: Replace uses of assert_promise_rejects because it was removed. 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/bluetooth/requestDevice/filter-does-not-match.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice/filter-does-not-match.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/filter-does-not-match.html
new file mode 100644
index 0000000000000000000000000000000000000000..df73a9c4df9d1522c3e5bce64d569ed3f1ffbb53
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice/filter-does-not-match.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../../resources/bluetooth/bluetooth-helpers.js"></script>
+<script>
+
+let matching_services = [heart_rate.uuid];
+let matching_name = 'Heart Rate Device';
+let matching_namePrefix = 'Heart';
+
+let non_matching_services = ['battery_service'];
+let non_matching_name = 'Some Device';
+let non_matching_namePrefix = 'Some';
+
+let test_specs = [{
+ filters: [{
+ services: non_matching_services,
+ name: non_matching_name,
+ namePrefix: non_matching_namePrefix
+ }]
+}, {
+ filters: [{
+ services: matching_services,
+ name: non_matching_name,
+ namePrefix: non_matching_namePrefix
+ }]
+}, {
+ filters: [{
+ services: non_matching_services,
+ name: matching_name,
+ namePrefix: non_matching_namePrefix
+ }]
+}, {
+ filters: [{
+ services: matching_services,
+ name: matching_name,
+ namePrefix: non_matching_namePrefix
+ }]
+}, {
+ filters: [{
+ services: non_matching_services,
+ name: non_matching_name,
+ namePrefix: matching_namePrefix
+ }]
+}, {
+ filters: [{
+ services: matching_services,
+ name: non_matching_name,
+ namePrefix: matching_namePrefix
+ }]
+}, {
+ filters: [{
+ services: non_matching_services,
+ name: matching_name,
+ namePrefix: matching_namePrefix
+ }]
+}, {
+ filters: [{
+ services: non_matching_services,
+ }]
+}, {
+ filters: [{
+ services: non_matching_services,
+ name: non_matching_name,
+ }]
+}, {
+ filters: [{
+ services: non_matching_services,
+ namePrefix: non_matching_namePrefix
+ }]
+}, {
+ filters: [{
+ name: non_matching_name,
+ }]
+}, {
+ filters: [{
+ name: non_matching_name,
+ namePrefix: non_matching_namePrefix
+ }]
+}, {
+ filters: [{
+ namePrefix: non_matching_namePrefix
+ }]
+}];
+
+promise_test(t => {
+ return setBluetoothFakeAdapter('GlucoseHeartRateAdapter')
+ .then(() => {
+ let test_promises = Promise.resolve();
+ test_specs.forEach(args => {
+ test_promises = test_promises.then(() => promise_rejects(
+ t, 'NotFoundError', requestDeviceWithKeyDown(args)));
+ });
+ return test_promises;
+ });
+}, 'If at least one filter member doesn\'t match the promise must reject.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698