feat(chromium): roll Chromium to r665405 (#4516)

* feat(chromium): roll Chromium to r665405

This roll includes:
- https://crrev.com/665226 - DevTools: make interception respect cross-process frame boundaries

This fixes page loading with dynamic OOPIFs - test is added.

Fix #4442

* fix lint
This commit is contained in:
Andrey Lushnikov 2019-06-04 11:03:15 -07:00 committed by GitHub
parent f52738ec1e
commit 78d5106dd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 11 deletions

View File

@ -8,7 +8,7 @@
"node": ">=6.4.0" "node": ">=6.4.0"
}, },
"puppeteer": { "puppeteer": {
"chromium_revision": "662092" "chromium_revision": "665405"
}, },
"scripts": { "scripts": {
"unit": "node test/test.js", "unit": "node test/test.js",

View File

@ -0,0 +1,10 @@
<script>
window.addEventListener('DOMContentLoaded', () => {
const iframe = document.createElement('iframe');
const url = new URL(location.href);
url.hostname = url.hostname === 'localhost' ? '127.0.0.1' : 'localhost';
url.pathname = '/grid.html';
iframe.src = url.toString();
document.body.appendChild(iframe);
}, false);
</script>

View File

@ -14,14 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
const utils = require('./utils');
module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, puppeteer}) { module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, puppeteer}) {
const {describe, xdescribe, fdescribe} = testRunner; const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit} = testRunner; const {it, fit, xit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
xdescribe('OOPIF', function() { describe('OOPIF', function() {
beforeAll(async function(state) { beforeAll(async function(state) {
state.browser = await puppeteer.launch(Object.assign({}, defaultBrowserOptions, { state.browser = await puppeteer.launch(Object.assign({}, defaultBrowserOptions, {
args: (defaultBrowserOptions.args || []).concat(['--site-per-process']), args: (defaultBrowserOptions.args || []).concat(['--site-per-process']),
@ -40,17 +38,24 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, p
await state.browser.close(); await state.browser.close();
state.browser = null; state.browser = null;
}); });
it('should report oopif frames', async function({page, server}) { xit('should report oopif frames', async function({page, server, context}) {
await page.goto(server.EMPTY_PAGE); await page.goto(server.PREFIX + '/dynamic-oopif.html');
await utils.attachFrame(page, 'oopif', server.CROSS_PROCESS_PREFIX + '/empty.html'); expect(oopifs(context).length).toBe(1);
expect(page.frames().length).toBe(2); expect(page.frames().length).toBe(2);
}); });
it('should load oopif iframes with subresources and request interception', async function({page, server}) { it('should load oopif iframes with subresources and request interception', async function({page, server, context}) {
await page.setRequestInterception(true); await page.setRequestInterception(true);
page.on('request', request => request.continue()); page.on('request', request => request.continue());
await page.goto(server.EMPTY_PAGE); await page.goto(server.PREFIX + '/dynamic-oopif.html');
await utils.attachFrame(page, 'oopif', server.CROSS_PROCESS_PREFIX + '/grid.html'); expect(oopifs(context).length).toBe(1);
expect(page.frames().length).toBe(2);
}); });
}); });
}; };
/**
* @param {!Puppeteer.BrowserContext} context
*/
function oopifs(context) {
return context.targets().filter(target => target._targetInfo.type === 'iframe');
}