feat: add app.getApplicationInfoForProtocol API (#24112)
* pre merge * windows changes * added tests * clean up * more cleanup * lint error * windows 7 support * added windows 7 implementation * code review * lint and code review * code review * app.md merge conflict * merge conflict app.md accidently deleted code block * 'lint' * mis-moved getapplicationinfoforprotocol() into anonymous namespace * fix test * lint * code review
This commit is contained in:
parent
2cbd091e89
commit
ee61eb9aa4
6 changed files with 261 additions and 20 deletions
|
@ -973,6 +973,23 @@ describe('app module', () => {
|
|||
});
|
||||
});
|
||||
|
||||
ifdescribe(process.platform !== 'linux')('getApplicationInfoForProtocol()', () => {
|
||||
it('returns promise rejection for a bogus protocol', async function () {
|
||||
await expect(
|
||||
app.getApplicationInfoForProtocol('bogus-protocol://')
|
||||
).to.eventually.be.rejectedWith(
|
||||
'Unable to retrieve installation path to app'
|
||||
);
|
||||
});
|
||||
|
||||
it('returns resolved promise with appPath, displayName and icon', async function () {
|
||||
const appInfo = await app.getApplicationInfoForProtocol('https://');
|
||||
expect(appInfo.path).not.to.be.undefined();
|
||||
expect(appInfo.name).not.to.be.undefined();
|
||||
expect(appInfo.icon).not.to.be.undefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('isDefaultProtocolClient()', () => {
|
||||
it('returns false for a bogus protocol', () => {
|
||||
expect(app.isDefaultProtocolClient('bogus-protocol://')).to.equal(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue