From 78d5106dd9b8a5a1d254316362e192f2322ad0b5 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 4 Jun 2019 11:03:15 -0700 Subject: [PATCH] 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 --- package.json | 2 +- test/assets/dynamic-oopif.html | 10 ++++++++++ test/oopif.spec.js | 25 +++++++++++++++---------- 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 test/assets/dynamic-oopif.html diff --git a/package.json b/package.json index cf5c61d02e3..50afb15b961 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "node": ">=6.4.0" }, "puppeteer": { - "chromium_revision": "662092" + "chromium_revision": "665405" }, "scripts": { "unit": "node test/test.js", diff --git a/test/assets/dynamic-oopif.html b/test/assets/dynamic-oopif.html new file mode 100644 index 00000000000..f00c741dfb7 --- /dev/null +++ b/test/assets/dynamic-oopif.html @@ -0,0 +1,10 @@ + diff --git a/test/oopif.spec.js b/test/oopif.spec.js index b33d16236c2..f3a4c3391c0 100644 --- a/test/oopif.spec.js +++ b/test/oopif.spec.js @@ -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'); +}