Skip to content

Commit

Permalink
feat(chromium): roll Chromium to r686378 (puppeteer#4841)
Browse files Browse the repository at this point in the history
This roll includes:
- https://crrev.com/685152 - [DevTools] Do not debug worker shadow pages
- https://crrev.com/683391 - [CSP] Check inline script CSP in prepare-a-script
- https://chromium-review.googlesource.com/c/v8/v8/+/1707331 - Ignore returnByValue when serializing caught value in promise rejections.
  • Loading branch information
aslushnikov authored and Roman Fojtik committed Dec 21, 2019
1 parent 33a64f7 commit ced654f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
14 changes: 3 additions & 11 deletions lib/Target.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
const {Events} = require('./Events');
const {Page} = require('./Page');
const {Worker} = require('./Worker');
const {Connection} = require('./Connection');

class Target {
/**
Expand Down Expand Up @@ -84,16 +83,9 @@ class Target {
if (this._targetInfo.type !== 'service_worker' && this._targetInfo.type !== 'shared_worker')
return null;
if (!this._workerPromise) {
this._workerPromise = this._sessionFactory().then(async client => {
// Top level workers have a fake page wrapping the actual worker.
const [targetAttached] = await Promise.all([
new Promise(x => client.once('Target.attachedToTarget', x)),
client.send('Target.setAutoAttach', {autoAttach: true, waitForDebuggerOnStart: false, flatten: true}),
]);
const session = Connection.fromSession(client).session(targetAttached.sessionId);
// TODO(einbinder): Make workers send their console logs.
return new Worker(session, this._targetInfo.url, () => {} /* consoleAPICalled */, () => {} /* exceptionThrown */);
});
// TODO(einbinder): Make workers send their console logs.
this._workerPromise = this._sessionFactory()
.then(client => new Worker(client, this._targetInfo.url, () => {} /* consoleAPICalled */, () => {} /* exceptionThrown */));
}
return this._workerPromise;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"node": ">=6.4.0"
},
"puppeteer": {
"chromium_revision": "682225"
"chromium_revision": "686378"
},
"scripts": {
"unit": "node test/test.js",
Expand Down
3 changes: 2 additions & 1 deletion test/page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,8 @@ module.exports.addTests = function({testRunner, expect, headless, puppeteer, CHR
expect(await page.evaluate(() => __injected)).toBe(35);
});

it_fails_ffox('should throw when added with content to the CSP page', async({page, server}) => {
// @see https://github.com/GoogleChrome/puppeteer/issues/4840
xit('should throw when added with content to the CSP page', async({page, server}) => {
await page.goto(server.PREFIX + '/csp.html');
let error = null;
await page.addScriptTag({ content: 'window.__injected = 35;' }).catch(e => error = e);
Expand Down

0 comments on commit ced654f

Please sign in to comment.