test(firefox): enable CSP tests that use new Function() (#1542)
This commit is contained in:
parent
09cbf335bd
commit
89e123b708
|
|
@ -9,7 +9,7 @@
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"playwright": {
|
"playwright": {
|
||||||
"chromium_revision": "751710",
|
"chromium_revision": "751710",
|
||||||
"firefox_revision": "1056",
|
"firefox_revision": "1057",
|
||||||
"webkit_revision": "1182"
|
"webkit_revision": "1182"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -288,6 +288,11 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT,
|
||||||
});
|
});
|
||||||
expect(result).toBe(42);
|
expect(result).toBe(42);
|
||||||
});
|
});
|
||||||
|
it('should work with new Function() and CSP', async({page, server}) => {
|
||||||
|
server.setCSP('/empty.html', 'script-src ' + server.PREFIX);
|
||||||
|
await page.goto(server.PREFIX + '/empty.html');
|
||||||
|
expect(await page.evaluate(() => new Function('return true')())).toBe(true);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Page.addInitScript', function() {
|
describe('Page.addInitScript', function() {
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ module.exports.describe = function({testRunner, expect, product, playwright, FFO
|
||||||
await page.evaluate(() => window.__FOO = 'hit');
|
await page.evaluate(() => window.__FOO = 'hit');
|
||||||
await watchdog;
|
await watchdog;
|
||||||
});
|
});
|
||||||
it.fail(FFOX)('should work with strict CSP policy', async({page, server}) => {
|
it('should work with strict CSP policy', async({page, server}) => {
|
||||||
server.setCSP('/empty.html', 'script-src ' + server.PREFIX);
|
server.setCSP('/empty.html', 'script-src ' + server.PREFIX);
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
let error = null;
|
let error = null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue