Skip to content

Commit

Permalink
test: fix event coverage on Chromium (#1693)
Browse files Browse the repository at this point in the history
Chromium events were mistakenly attributed to Firefox.
  • Loading branch information
dgozman authored Apr 7, 2020
1 parent 222d01c commit 118333a
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions test/playwright.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,6 @@ const {TestServer} = require('../utils/testserver/');
const YELLOW_COLOR = '\x1b[33m';
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}
*/
Expand Down Expand Up @@ -265,6 +243,28 @@ module.exports.addPlaywrightTests = ({platform, products, playwrightPath, headle
});

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 api = require('../lib/api');
const filteredApi = {};
Expand Down

0 comments on commit 118333a

Please sign in to comment.