Skip to content

test: add Linux-specific test for app.getApplicationNameForProtocol() - #51197

Merged
jkleinsc merged 2 commits into
mainfrom
test/add-linux-xdg-tests
Apr 21, 2026
Merged

jkleinsc merged 2 commits into
mainfrom
test/add-linux-xdg-tests

Conversation

@ckerr

@ckerr ckerr commented Apr 21, 2026 •

Copy link
Copy Markdown
Member

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 new xdg-mime process. That half will only target 42-x-y.

Related: #51099

Checklist

Release Notes

Notes: none.

@ckerr ckerr added semver/none target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. labels Apr 21, 2026
@ckerr ckerr changed the title test: add Linux-specific test for getApplicationNameForProtocol() test: add Linux-specific test for app.getApplicationNameForProtocol() Apr 21, 2026
@ckerr
ckerr force-pushed the test/add-linux-xdg-tests branch 2 times, most recently from 1f72034 to 5b2d1f1 Compare April 21, 2026 05:09

@codebytere codebytere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

ckerr added 2 commits April 21, 2026 09:05
On Linux, use XDG env vars to inject a mock that we can use
to test app.getApplicationNameForProtocol().
@ckerr
ckerr force-pushed the test/add-linux-xdg-tests branch from 4576ee4 to 91a427e Compare April 21, 2026 14:34
@jkleinsc
jkleinsc merged commit 5ed6e4b into main Apr 21, 2026
121 of 124 checks passed
@jkleinsc
jkleinsc deleted the test/add-linux-xdg-tests branch April 21, 2026 17:16
@release-clerk

release-clerk Bot commented Apr 21, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #51214

@trop trop Bot removed the target/42-x-y PR should also be added to the "42-x-y" branch. label Apr 21, 2026
@trop

trop Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "41-x-y", please check out #51215

@trop

trop Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "40-x-y", please check out #51216

@trop trop Bot added in-flight/41-x-y in-flight/40-x-y merged/40-x-y PR was merged to the "40-x-y" branch. and removed target/41-x-y PR should also be added to the "41-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. in-flight/40-x-y labels Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. semver/none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants