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

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: remove all testharness-helpers.js references 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.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice.html b/third_party/WebKit/LayoutTests/bluetooth/requestDevice.html
index 82b13b0e5552fb2b9134f00264754c7f0bb26da2..79c6f19e5ad386adf77a9ff8bc6822e790d47ee6 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/requestDevice.html
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
-<script src="../resources/testharness-helpers.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../resources/bluetooth/bluetooth-helpers.js"></script>
<script>
@@ -82,15 +81,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 +99,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 +193,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(() => {
« no previous file with comments | « third_party/WebKit/LayoutTests/PRESUBMIT.py ('k') | third_party/WebKit/LayoutTests/bluetooth/requestDevice-blacklist.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698