refactor: generate 'chrome:// pages' specs to remove duplicate code (#39684)
This commit is contained in:
parent
9280b79112
commit
e66c1f6c56
1 changed files with 20 additions and 41 deletions
|
@ -2050,48 +2050,27 @@ describe('chromium features', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('chrome://accessibility', () => {
|
describe('chrome:// pages', () => {
|
||||||
it('loads the page successfully', async () => {
|
const urls = [
|
||||||
const w = new BrowserWindow({ show: false });
|
'chrome://accessibility',
|
||||||
await w.loadURL('chrome://accessibility');
|
'chrome://gpu',
|
||||||
const pageExists = await w.webContents.executeJavaScript(
|
'chrome://media-internals',
|
||||||
"window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')"
|
'chrome://tracing',
|
||||||
);
|
'chrome://webrtc-internals'
|
||||||
expect(pageExists).to.be.true();
|
];
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('chrome://gpu', () => {
|
for (const url of urls) {
|
||||||
it('loads the page successfully', async () => {
|
describe(url, () => {
|
||||||
const w = new BrowserWindow({ show: false });
|
it('loads the page successfully', async () => {
|
||||||
await w.loadURL('chrome://gpu');
|
const w = new BrowserWindow({ show: false });
|
||||||
const pageExists = await w.webContents.executeJavaScript(
|
await w.loadURL(url);
|
||||||
"window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')"
|
const pageExists = await w.webContents.executeJavaScript(
|
||||||
);
|
"window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')"
|
||||||
expect(pageExists).to.be.true();
|
);
|
||||||
});
|
expect(pageExists).to.be.true();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
describe('chrome://media-internals', () => {
|
}
|
||||||
it('loads the page successfully', async () => {
|
|
||||||
const w = new BrowserWindow({ show: false });
|
|
||||||
await w.loadURL('chrome://media-internals');
|
|
||||||
const pageExists = await w.webContents.executeJavaScript(
|
|
||||||
"window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')"
|
|
||||||
);
|
|
||||||
expect(pageExists).to.be.true();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('chrome://webrtc-internals', () => {
|
|
||||||
it('loads the page successfully', async () => {
|
|
||||||
const w = new BrowserWindow({ show: false });
|
|
||||||
await w.loadURL('chrome://webrtc-internals');
|
|
||||||
const pageExists = await w.webContents.executeJavaScript(
|
|
||||||
"window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')"
|
|
||||||
);
|
|
||||||
expect(pageExists).to.be.true();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('document.hasFocus', () => {
|
describe('document.hasFocus', () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue