Visitar URL original
browser.alarms.clearAll() should return Promise<undefined> by kiaraarose · Pull Request #76286 · WebKit/WebKit · GitHub
Skip to content

browser.alarms.clearAll() should return Promise<undefined> - #76286

Open
kiaraarose wants to merge 1 commit into
WebKit:mainfrom
kiaraarose:bug/323876
Open

kiaraarose wants to merge 1 commit into
WebKit:mainfrom
kiaraarose:bug/323876

Conversation

@kiaraarose

@kiaraarose kiaraarose commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

f415603

browser.alarms.clearAll() should return Promise<undefined>
https://bugs.webkit.org/show_bug.cgi?id=323876
rdar://problem/187115327

Reviewed by NOBODY (OOPS!).

Per w3c/webextensions#1055, we should return undefined for alarms.clearAll()

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIAlarms.swift

* Source/WebKit/UIProcess/Extensions/API/WebExtensionContextAPIAlarms.cpp:
(WebKit::WebExtensionContext::alarmsClearAll):
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in:
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIAlarms.cpp:
(WebKit::WebExtensionAPIAlarms::clearAll):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIAlarms.swift:
(WKWebExtensionAPIAlarmsTests.clearAllAlarms):

f415603

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-AS-debug-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 gtk-wk2
❌ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🛠 mac-safer-cpp ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

https://bugs.webkit.org/show_bug.cgi?id=323876
rdar://problem/187115327

Reviewed by NOBODY (OOPS!).

Per w3c/webextensions#1055, we should return undefined for alarms.clearAll()

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIAlarms.swift

* Source/WebKit/UIProcess/Extensions/API/WebExtensionContextAPIAlarms.cpp:
(WebKit::WebExtensionContext::alarmsClearAll):
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.h:
* Source/WebKit/UIProcess/Extensions/WebExtensionContext.messages.in:
* Source/WebKit/WebProcess/Extensions/API/WebExtensionAPIAlarms.cpp:
(WebKit::WebExtensionAPIAlarms::clearAll):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKWebExtensionAPIAlarms.swift:
(WKWebExtensionAPIAlarmsTests.clearAllAlarms):
@kiaraarose kiaraarose self-assigned this Oct 8, 2026
@kiaraarose kiaraarose added the WebKit Extensions Bugs related to extension support. label Oct 8, 2026
@kiaraarose kiaraarose added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Oct 8, 2026
@webkit-ews-buildbot webkit-ews-buildbot added merge-queue Applied to send a pull request to merge-queue and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Oct 9, 2026
@webkit-ews-buildbot

Copy link
Copy Markdown
Collaborator

Safe-Merge-Queue: Build #107004.

@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Commit message contains (OOPS!) and no valid reviewer found, blocking PR #76286. Details: Build #43225

@webkit-commit-queue webkit-commit-queue added merging-blocked Applied to prevent a change from being merged and removed merge-queue Applied to send a pull request to merge-queue labels Oct 9, 2026

browser.test.assertTrue(await browser.alarms.clearAll(), 'Should return true when alarms were cleared.')
browser.test.assertFalse(await browser.alarms.clearAll(), 'Should return false once all alarms are gone.')
await browser.alarms.clearAll()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this return undefined, or just not have a return value at all? Can we verify that the result was undefined in any way?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WPT already has the following assertion:

const cleared = await browser.alarms.clearAll();
browser.test.assertEq(undefined, cleared, 'clearAll should return undefined');

https://github.com/web-platform-tests/wpt/pull/62518/changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merging-blocked Applied to prevent a change from being merged WebKit Extensions Bugs related to extension support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants