Bug 1705740 [wpt PR 28546] - NativeIO: Fix null pointer when throwing on releaseCapacity, a=testonly

Automatic update from web-platform-tests
NativeIO: Fix null pointer when throwing on releaseCapacity

This fixes a null pointer to the context when throwing on
releaseCapacity. Although the problem cannot happen for the sync case,
the corresponding logic is adapted to match the async case.

Bug: 1199639
Change-Id: Iaa7fd6d5bdcb3a616ba59f7c419b11203c293e67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2831590
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Richard Stotz <rstz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874298}

--

wpt-commits: 77ca851359d5bcc5e7c40168b6473bea51de4daa
wpt-pr: 28546
This commit is contained in:
Richard Stotz 2021-04-24 09:11:30 +00:00 коммит произвёл moz-wptsync-bot
Родитель ce12734585
Коммит d9945e0bcb
2 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,9 @@
// META: title=NativeIO API: Failure handling for capacity allocation.
// META: global=window,worker
'use strict';
promise_test(async testCase => {
await promise_rejects_dom(
testCase, 'QuotaExceededError', storageFoundation.releaseCapacity(10));
}, 'Attempting to release more capacity than available fails.');

Просмотреть файл

@ -0,0 +1,10 @@
// META: title=NativeIO API: Failure handling for capacity allocation.
// META: global=dedicatedworker
'use strict';
test(testCase => {
assert_throws_dom(
'QuotaExceededError',
() => storageFoundation.releaseCapacitySync(10));
}, 'Attempting to release more capacity than available fails.');