test: fix event coverage on Chromium (#1693)
Chromium events were mistakenly attributed to Firefox.
This commit is contained in:
parent
222d01caaa
commit
118333ad37
|
|
@ -23,28 +23,6 @@ const {TestServer} = require('../utils/testserver/');
|
||||||
const YELLOW_COLOR = '\x1b[33m';
|
const YELLOW_COLOR = '\x1b[33m';
|
||||||
const RESET_COLOR = '\x1b[0m';
|
const RESET_COLOR = '\x1b[0m';
|
||||||
|
|
||||||
const BROWSER_CONFIGS = [
|
|
||||||
{
|
|
||||||
name: 'Firefox',
|
|
||||||
events: {
|
|
||||||
...require('../lib/events').Events,
|
|
||||||
...require('../lib/chromium/events').Events,
|
|
||||||
},
|
|
||||||
missingCoverage: ['browserContext.setGeolocation', 'browserContext.setOffline', 'cDPSession.send', 'cDPSession.detach'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'WebKit',
|
|
||||||
events: require('../lib/events').Events,
|
|
||||||
missingCoverage: ['browserContext.clearPermissions', 'cDPSession.send', 'cDPSession.detach'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Chromium',
|
|
||||||
events: require('../lib/events').Events,
|
|
||||||
missingCoverage: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const browserNames = BROWSER_CONFIGS.map(config => config.name);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {TestSuite}
|
* @type {TestSuite}
|
||||||
*/
|
*/
|
||||||
|
|
@ -265,6 +243,28 @@ module.exports.addPlaywrightTests = ({platform, products, playwrightPath, headle
|
||||||
});
|
});
|
||||||
|
|
||||||
if (coverage) {
|
if (coverage) {
|
||||||
|
const BROWSER_CONFIGS = [
|
||||||
|
{
|
||||||
|
name: 'Firefox',
|
||||||
|
events: require('../lib/events').Events,
|
||||||
|
missingCoverage: ['browserContext.setGeolocation', 'browserContext.setOffline', 'cDPSession.send', 'cDPSession.detach'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'WebKit',
|
||||||
|
events: require('../lib/events').Events,
|
||||||
|
missingCoverage: ['browserContext.clearPermissions', 'cDPSession.send', 'cDPSession.detach'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Chromium',
|
||||||
|
events: {
|
||||||
|
...require('../lib/events').Events,
|
||||||
|
...require('../lib/chromium/events').Events,
|
||||||
|
},
|
||||||
|
// Sometimes we already have a background page while launching, before adding a listener.
|
||||||
|
missingCoverage: ['chromiumBrowserContext.emit("backgroundpage")'],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const browserNames = BROWSER_CONFIGS.map(config => config.name);
|
||||||
const browserConfig = BROWSER_CONFIGS.find(config => config.name === product);
|
const browserConfig = BROWSER_CONFIGS.find(config => config.name === product);
|
||||||
const api = require('../lib/api');
|
const api = require('../lib/api');
|
||||||
const filteredApi = {};
|
const filteredApi = {};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue