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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice-matches-a-filter.html

Issue 1815483003: bluetooth: Create Mojo equivalent of SetBluetoothMockDataSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo
Patch Set: MMerge with ToT Created 4 years, 9 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-matches-a-filter.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice-matches-a-filter.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice-matches-a-filter.html
index 4a07dc15cf122d70542fdbbfd1540c20cdfb77f3..4257dd2d861bb10a0e83fd03c0f0b2eefeedb23f 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice-matches-a-filter.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice-matches-a-filter.html
@@ -61,9 +61,10 @@ let non_matching_namePrefix = 'Some';
}]
}].forEach(args => {
promise_test(() => {
- testRunner.setBluetoothMockDataSet('GlucoseHeartRateAdapter');
- return assert_promise_rejects(requestDeviceWithKeyDown(args),
- new DOMException('', 'NotFoundError'));
+ return setBluetoothFakeAdapter('GlucoseHeartRateAdapter')
+ .then(() => assert_promise_rejects(
+ requestDeviceWithKeyDown(args),
+ new DOMException('', 'NotFoundError')));
}, 'If at least one filter doesn\'t match the promise must reject.');
});
@@ -96,9 +97,10 @@ let non_matching_namePrefix = 'Some';
}]
}].forEach(args => {
promise_test(() => {
- testRunner.setBluetoothMockDataSet('GlucoseHeartRateAdapter');
- return assert_promise_rejects(requestDeviceWithKeyDown(args),
- new DOMException('', 'NotFoundError'));
+ return setBluetoothFakeAdapter('GlucoseHeartRateAdapter')
+ .then(() => assert_promise_rejects(
+ requestDeviceWithKeyDown(args),
+ new DOMException('', 'NotFoundError')));
}, 'If a present filter\'s member doesn\'t match the device, ' +
'the device doesn\'t match the filter.');
});
@@ -141,14 +143,14 @@ let non_matching_namePrefix = 'Some';
}]
}].forEach(args => {
promise_test(() => {
- testRunner.setBluetoothMockDataSet('GlucoseHeartRateAdapter');
- return requestDeviceWithKeyDown(args).then(device => {
+ return setBluetoothFakeAdapter('GlucoseHeartRateAdapter')
+ .then(() => requestDeviceWithKeyDown(args)).then(device => {
// We always have access to the services in matching_services
// because we include them in a filter or in optionalServices.
assert_in_array(matching_services[0], device.uuids);
assert_equals(device.name, matching_name);
assert_true(device.name.startsWith(matching_namePrefix));
});
- }, 'Matches a filter if all present members match.')
+ }, 'Matches a filter if all present members match.');
});
</script>

Powered by Google App Engine
This is Rietveld 408576698