Repository navigation
test: add Linux-specific test for app.getApplicationNameForProtocol() - #51197
Merged
Merged
Conversation
app.getApplicationNameForProtocol()
dsanders11
approved these changes
Apr 21, 2026
ckerr
force-pushed
the
test/add-linux-xdg-tests
branch
2 times, most recently
from
April 21, 2026 05:09
1f72034 to
5b2d1f1
Compare
codebytere
reviewed
Apr 21, 2026
codebytere
left a comment
Member
There was a problem hiding this comment.
not ok 1 app module getApplicationNameForProtocol() on Linux with mocked XDG dirs returns the desktop file ID for a registered protocol
expected '' to equal 'mock-browser.desktop'
AssertionError: expected '' to equal 'mock-browser.desktop'
at Context.<anonymous> (electron/spec/api-app-spec.ts:1585:25)
test seems to be failing
On Linux, use XDG env vars to inject a mock that we can use to test app.getApplicationNameForProtocol().
better system mocks
ckerr
force-pushed
the
test/add-linux-xdg-tests
branch
from
April 21, 2026 14:34
4576ee4 to
91a427e
Compare
jkleinsc
approved these changes
Apr 21, 2026
|
No Release Notes |
This was referenced Apr 21, 2026
Contributor
|
I have automatically backported this PR to "42-x-y", please check out #51214 |
Contributor
|
I have automatically backported this PR to "41-x-y", please check out #51215 |
Contributor
|
I have automatically backported this PR to "40-x-y", please check out #51216 |
This was referenced Apr 22, 2026
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Part 1 of 2 to improve
app.getApplicationNameForProtocol()on Linux.This half is test-only: It adds XDG env vars to inject mock deskop values so that we can test
app.getApplicationNameForProtocol()on Linux with those values.The other half will reimplement the C++ code to call
g_app_info_get_default_for_uri_scheme()+g_app_info_get_display_name()instead of spawning a newxdg-mimeprocess. That half will only target 42-x-y.Related: #51099
Checklist
npm testpassesRelease Notes
Notes: none.