Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(chromium): roll Chromium to r665405 #4516

Merged
merged 2 commits into from
Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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": "662092"
"chromium_revision": "665405"
},
"scripts": {
"unit": "node test/test.js",
Expand Down
10 changes: 10 additions & 0 deletions test/assets/dynamic-oopif.html
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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');
}