fix: defaultFontFamily in webPreferences (#37863)
* fix: defaultFontFamily in webPreferences * chore: check if default_font_family_ is empty
This commit is contained in:
parent
fceeb64e7c
commit
e84bcb39e7
2 changed files with 40 additions and 18 deletions
|
@ -3867,6 +3867,22 @@ describe('BrowserWindow module', () => {
|
|||
expect(w.getSize()).to.deep.equal(size);
|
||||
});
|
||||
});
|
||||
|
||||
describe('"defaultFontFamily" option', () => {
|
||||
it('can change the standard font family', async () => {
|
||||
const w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
defaultFontFamily: {
|
||||
standard: 'Impact'
|
||||
}
|
||||
}
|
||||
});
|
||||
await w.loadFile(path.join(fixtures, 'pages', 'content.html'));
|
||||
const fontFamily = await w.webContents.executeJavaScript("window.getComputedStyle(document.getElementsByTagName('p')[0])['font-family']", true);
|
||||
expect(fontFamily).to.equal('Impact');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('beforeunload handler', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue