Commit 4671f35e authored by Blink WPT Bot's avatar Blink WPT Bot Committed by aborovova@mozilla.com
Browse files

Bug 1966538 [wpt PR 52556] - QuotaExceededError: Update to a DOMException derived interface,

Automatic update from web-platform-tests
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: https://github.com/whatwg/webidl/pull/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: default avatarDomenic Denicola <domenic@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Reviewed-by: default avatarJoey Arhar <jarhar@chromium.org>
Reviewed-by: default avatarJoe Mason <joenotcharles@google.com>
Cr-Commit-Position: refs/heads/main@{#1460403}

Co-authored-by: default avatarAyu Ishii <ayui@chromium.org>
--

wpt-commits: 16a71c4282b0379f639051c0a3f98f3fcdaa2149
wpt-pr: 52556

Differential Revision: https://phabricator.services.mozilla.com/D250632
parent 0f3b24ca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2321,7 +2321,6 @@
                NetworkError: 19,
                AbortError: 20,
                URLMismatchError: 21,
                QuotaExceededError: 22,
                TimeoutError: 23,
                InvalidNodeTypeError: 24,
                DataCloneError: 25,
@@ -2336,7 +2335,8 @@
                VersionError: 0,
                OperationError: 0,
                NotAllowedError: 0,
                OptOutError: 0
                OptOutError: 0,
                QuotaExceededError: 0
            };

            var code_name_map = {};
+5 −2
Original line number Diff line number Diff line
@@ -34,8 +34,11 @@ promise_test(async t => {
    type: 'binary/random'
  }), 2);

  await promise_rejects_dom(
      t, 'QuotaExceededError', transactionPromise(txn));
  try {
    await transactionPromise(txn);
  } catch (e) {
    assert_equals(e.name, 'QuotaExceededError');
  }

  db.close();
}, 'IDB respects bucket quota');
+3 −2
Original line number Diff line number Diff line
@@ -107,7 +107,6 @@ test(function() {
  {name: "NetworkError", code: 19},
  {name: "AbortError", code: 20},
  {name: "URLMismatchError", code: 21},
  {name: "QuotaExceededError", code: 22},
  {name: "TimeoutError", code: 23},
  {name: "InvalidNodeTypeError", code: 24},
  {name: "DataCloneError", code: 25},
@@ -128,7 +127,9 @@ test(function() {
  {name: "ReadOnlyError", code: 0},
  {name: "VersionError", code: 0},
  {name: "OperationError", code: 0},
  {name: "NotAllowedError", code: 0}
  {name: "NotAllowedError", code: 0},
  // See https://github.com/whatwg/webidl/pull/1465.
  {name: "QuotaExceededError", code: 0}
].forEach(function(test_case) {
  test(function() {
    var ex = new DOMException("msg", test_case.name);