From 0dd2fbd0183a746f71f2be4de6114c9b5857a4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Wed, 23 Jan 2019 12:55:55 +0100 Subject: [PATCH] Add assert descriptions to Web Locks test to aid debugging For https://github.com/web-platform-tests/wpt/issues/15015. --- web-locks/signal.tentative.https.any.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web-locks/signal.tentative.https.any.js b/web-locks/signal.tentative.https.any.js index 5b8acbbbebc52a..e0b6e4eabd6138 100644 --- a/web-locks/signal.tentative.https.any.js +++ b/web-locks/signal.tentative.https.any.js @@ -50,8 +50,10 @@ promise_test(async t => { // Verify the request is enqueued: const state = await navigator.locks.query(); - assert_equals(state.held.filter(lock => lock.name === res).length, 1); - assert_equals(state.pending.filter(lock => lock.name === res).length, 1); + assert_equals(state.held.filter(lock => lock.name === res).length, 1, + 'Number of held locks'); + assert_equals(state.pending.filter(lock => lock.name === res).length, 1, + 'Number of pending locks'); const rejected = promise_rejects( t, 'AbortError', promise, 'Request should reject with AbortError'); @@ -76,8 +78,10 @@ promise_test(async t => { // Verify the request is enqueued: const state = await navigator.locks.query(); - assert_equals(state.held.filter(lock => lock.name === res).length, 1); - assert_equals(state.pending.filter(lock => lock.name === res).length, 1); + assert_equals(state.held.filter(lock => lock.name === res).length, 1, + 'Number of held locks'); + assert_equals(state.pending.filter(lock => lock.name === res).length, 1, + 'Number of pending locks'); const rejected = promise_rejects( t, 'AbortError', promise, 'Request should reject with AbortError');