Skip to content

Commit

Permalink
feat(chromium): roll Chromium to r665405 (#4516)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
aslushnikov committed Jun 4, 2019
1 parent f52738e commit 78d5106
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -8,7 +8,7 @@
"node": ">=6.4.0"
},
"puppeteer": {
"chromium_revision": "662092"
"chromium_revision": "665405"
},
"scripts": {
"unit": "node test/test.js",
Expand Down
10 changes: 10 additions & 0 deletions test/assets/dynamic-oopif.html
@@ -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>
25 changes: 15 additions & 10 deletions test/oopif.spec.js
Expand Up @@ -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']),
Expand All @@ -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');
}

0 comments on commit 78d5106

Please sign in to comment.