[webkit-changes] [WebKit/WebKit] 978cca: Improve error handling for badging API

Marcos Cáceres noreply at github.com
Tue Mar 28 15:23:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 978ccadf6e0baf1d12fb5d43a1b515ffb45b20e6
      https://github.com/WebKit/WebKit/commit/978ccadf6e0baf1d12fb5d43a1b515ffb45b20e6
  Author: Marcos Caceres <marcos at marcosc.com>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/badging/META.yml
    A LayoutTests/imported/w3c/web-platform-tests/badging/badge-error.https-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/badging/badge-error.https.html
    A LayoutTests/imported/w3c/web-platform-tests/badging/badge-success.https-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/badging/badge-success.https.html
    A LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any.html
    A LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any.js
    A LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any.worker-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any.worker.html
    A LayoutTests/imported/w3c/web-platform-tests/badging/non-fully-active.https-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/badging/non-fully-active.https.html
    A LayoutTests/imported/w3c/web-platform-tests/badging/w3c-import.log
    M LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/navigator/007.js
    M LayoutTests/platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt
    M LayoutTests/platform/mac-wk1/TestExpectations
    M LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt
    M LayoutTests/platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt
    M Source/WebCore/page/Navigator.cpp
    M Source/WebCore/page/WorkerNavigator.cpp
    M Tools/WebKitTestRunner/TestOptions.cpp

  Log Message:
  -----------
  Improve error handling for badging API
https://bugs.webkit.org/show_bug.cgi?id=254193
rdar://106969959

Reviewed by Brady Eidson.

Adds InvalidStateErrors for promise rejections.
Now checks if the document is fully active before setting the badge, and rejects if it's not.

* LayoutTests/imported/w3c/web-platform-tests/badging/META.yml: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/badge-error.https-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/badge-error.https.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/badge-success.https-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/badge-success.https.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any.js: Added.
(idl_array.self.GLOBAL.isWorker):
* LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any.worker-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/idlharness.https.any.worker.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/non-fully-active.https-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/non-fully-active.https.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/badging/w3c-import.log: Added.
* LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/navigator/007.js:
* LayoutTests/platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt:
* LayoutTests/platform/mac-wk1/TestExpectations:
* LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
* LayoutTests/platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt:
* Source/WebCore/page/Navigator.cpp:
(WebCore::Navigator::setAppBadge):
* Source/WebCore/page/WorkerNavigator.cpp:
(WebCore::WorkerNavigator::setAppBadge):
* Tools/WebKitTestRunner/TestOptions.cpp:
(WTR::TestOptions::defaults):

Canonical link: https://commits.webkit.org/262237@main




More information about the webkit-changes mailing list