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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice.html

Issue 1926813004: Replace assert_promise_rejects with upstream promise_rejects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update testharness.js and rebase Created 4 years, 8 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.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice.html
index 82b13b0e5552fb2b9134f00264754c7f0bb26da2..de31632a5b2589944364cfe1fecca0b9decefb9f 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice.html
@@ -82,15 +82,15 @@ promise_test(() => {
});
}, 'Mock will resolve.');
-promise_test(() => {
+promise_test(t => {
return setBluetoothFakeAdapter('HeartRateAdapter')
- .then(() => assert_promise_rejects(
+ .then(() => promise_rejects(t,
+ 'SecurityError',
navigator.bluetooth.requestDevice({
- filters: [{services: ['heart_rate']}]}),
- new DOMException('', 'SecurityError')));
+ filters: [{services: ['heart_rate']}]})));
}, 'Requires a user gesture.');
-promise_test(() => {
+promise_test(t => {
return setBluetoothFakeAdapter('HeartRateAdapter')
.then(() => callWithKeyDown(() => {
var first = navigator.bluetooth.requestDevice({
@@ -100,7 +100,7 @@ promise_test(() => {
return Promise.all([
first.then(device => assert_equals(
device.constructor.name, 'BluetoothDevice')),
- assert_promise_rejects(second, new DOMException('', 'SecurityError')),
+ promise_rejects(t, 'SecurityError', second),
]);
}));
}, 'Consumes a user gesture.');
@@ -194,15 +194,15 @@ promise_test(() => {
}, 'We should only see UUID\'s that we\'ve been given permission for.')
-promise_test(() => {
+promise_test(t => {
// Both devices support the Generic Access service, but things need to
// support both services to pass the filter, and neither has a Battery
// service.
return setBluetoothFakeAdapter('GlucoseHeartRateAdapter')
- .then(() => assert_promise_rejects(
+ .then(() => promise_rejects(t, 'NotFoundError',
requestDeviceWithKeyDown({
filters: [{services: ['heart_rate', 'battery_service']}]
- }), new DOMException('', 'NotFoundError')));
+ })));
}, 'Too-strict filters do prevent matching.');
promise_test(() => {

Powered by Google App Engine
This is Rietveld 408576698