Skip to content

Commit 16a71c4

Browse files
QuotaExceededError: Update to a DOMException derived interface (#52556)
This change introduces a new QuotaExceededError class to update the existing QuotaExceededError so services can return `quota` and `requested` properties as needed. Implemented behind RuntimeEnabledFlag `QuotaExceededErrorUpdate`. Changes to update services throwing QuotaExceededError to use the new class will be made in following changes (except for IDB which triggered failures with this change). Proposal: whatwg/webidl#1465 Chromestatus: https://chromestatus.com/feature/6194847180128256 Bug: 406162261 Change-Id: I68e91e15724e64c0995365ee63d4abe627fe06d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6516473 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Ayu Ishii <ayui@chromium.org> Reviewed-by: Joey Arhar <jarhar@chromium.org> Reviewed-by: Joe Mason <joenotcharles@google.com> Cr-Commit-Position: refs/heads/main@{#1460403} Co-authored-by: Ayu Ishii <ayui@chromium.org>
1 parent 1204830 commit 16a71c4

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

resources/testharness.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,6 @@
23212321
NetworkError: 19,
23222322
AbortError: 20,
23232323
URLMismatchError: 21,
2324-
QuotaExceededError: 22,
23252324
TimeoutError: 23,
23262325
InvalidNodeTypeError: 24,
23272326
DataCloneError: 25,
@@ -2336,7 +2335,8 @@
23362335
VersionError: 0,
23372336
OperationError: 0,
23382337
NotAllowedError: 0,
2339-
OptOutError: 0
2338+
OptOutError: 0,
2339+
QuotaExceededError: 0
23402340
};
23412341

23422342
var code_name_map = {};

storage/buckets/bucket-quota-indexeddb.tentative.https.any.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ promise_test(async t => {
3434
type: 'binary/random'
3535
}), 2);
3636

37-
await promise_rejects_dom(
38-
t, 'QuotaExceededError', transactionPromise(txn));
37+
try {
38+
await transactionPromise(txn);
39+
} catch (e) {
40+
assert_equals(e.name, 'QuotaExceededError');
41+
}
3942

4043
db.close();
4144
}, 'IDB respects bucket quota');

webidl/ecmascript-binding/es-exceptions/DOMException-constructor-behavior.any.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ test(function() {
107107
{name: "NetworkError", code: 19},
108108
{name: "AbortError", code: 20},
109109
{name: "URLMismatchError", code: 21},
110-
{name: "QuotaExceededError", code: 22},
111110
{name: "TimeoutError", code: 23},
112111
{name: "InvalidNodeTypeError", code: 24},
113112
{name: "DataCloneError", code: 25},
@@ -128,7 +127,9 @@ test(function() {
128127
{name: "ReadOnlyError", code: 0},
129128
{name: "VersionError", code: 0},
130129
{name: "OperationError", code: 0},
131-
{name: "NotAllowedError", code: 0}
130+
{name: "NotAllowedError", code: 0},
131+
// See https://github.com/whatwg/webidl/pull/1465.
132+
{name: "QuotaExceededError", code: 0}
132133
].forEach(function(test_case) {
133134
test(function() {
134135
var ex = new DOMException("msg", test_case.name);

0 commit comments

Comments
 (0)