Skip to content

Commit

Permalink
test(firefox): enable CSP tests that use new Function() (#1542)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s committed Mar 26, 2020
1 parent 09cbf33 commit 89e123b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
"main": "index.js",
"playwright": {
"chromium_revision": "751710",
"firefox_revision": "1056",
"firefox_revision": "1057",
"webkit_revision": "1182"
},
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions test/evaluation.spec.js
Expand Up @@ -288,6 +288,11 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT,
});
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() {
Expand Down
2 changes: 1 addition & 1 deletion test/waittask.spec.js
Expand Up @@ -117,7 +117,7 @@ module.exports.describe = function({testRunner, expect, product, playwright, FFO
await page.evaluate(() => window.__FOO = 'hit');
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);
await page.goto(server.EMPTY_PAGE);
let error = null;
Expand Down

0 comments on commit 89e123b

Please sign in to comment.