Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/extension-runners/chromium.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export class ChromiumExtensionRunner {
const runnerName = this.getName();

if (this.forceUseDeprecatedLoadExtension) {
this.reloadAllExtensionsFallbackForChrome125andEarlier();
await this.reloadAllExtensionsFallbackForChrome125andEarlier();
} else {
for (const { sourceDir } of this.params.extensions) {
try {
Expand Down
33 changes: 33 additions & 0 deletions tests/unit/test-extension-runners/test.chromium.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,39 @@ describe('util/extension-runners/chromium', async () => {
sinon.assert.calledOnce(fakeChromeInstance.kill);
});

it('rejects when reloading fails (old Chrome)', async () => {
const { params } = prepareExtensionRunnerParams(
{},
{ loadUnpackedUnsupported: true },
);
const runnerInstance = new ChromiumExtensionRunner(params);

await runnerInstance.run();
assert.isTrue(runnerInstance.forceUseDeprecatedLoadExtension);

sinon
.stub(runnerInstance.cdp, 'sendCommand')
.rejects(new Error('CDP failure'));
const stdoutSpy = sinon.spy(process.stdout, 'write');

try {
await assert.isRejected(
runnerInstance.reloadAllExtensions(),
/CDP failure/,
);
assert.isFalse(
stdoutSpy.getCalls().some((call) => {
return String(call.args[0]).includes('Last extension reload');
}),
'expected no reload success message when the reload failed',
);
} finally {
stdoutSpy.restore();
}

await runnerInstance.exit();
});

describe('getPrefs', () => {
it('merges default and custom preferences from an object and passes them to the launcher', async () => {
const { params } = prepareExtensionRunnerParams({
Expand Down