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"
},
"puppeteer": {
"chromium_revision": "662092"
"chromium_revision": "665405"
},
"scripts": {
"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.
*/
const utils = require('./utils');
module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, puppeteer}) {
const {describe, xdescribe, fdescribe} = testRunner;
const {it, fit, xit} = testRunner;
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
xdescribe('OOPIF', function() {
describe('OOPIF', function() {
beforeAll(async function(state) {
state.browser = await puppeteer.launch(Object.assign({}, defaultBrowserOptions, {
args: (defaultBrowserOptions.args || []).concat(['--site-per-process']),
@ -40,17 +38,24 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, p
await state.browser.close();
state.browser = null;
});
it('should report oopif frames', async function({page, server}) {
await page.goto(server.EMPTY_PAGE);
await utils.attachFrame(page, 'oopif', server.CROSS_PROCESS_PREFIX + '/empty.html');
xit('should report oopif frames', async function({page, server, context}) {
await page.goto(server.PREFIX + '/dynamic-oopif.html');
expect(oopifs(context).length).toBe(1);
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);
page.on('request', request => request.continue());
await page.goto(server.EMPTY_PAGE);
await utils.attachFrame(page, 'oopif', server.CROSS_PROCESS_PREFIX + '/grid.html');
expect(page.frames().length).toBe(2);
await page.goto(server.PREFIX + '/dynamic-oopif.html');
expect(oopifs(context).length).toBe(1);
});
});
};
/**
* @param {!Puppeteer.BrowserContext} context
*/
function oopifs(context) {
return context.targets().filter(target => target._targetInfo.type === 'iframe');
}