feat(chromium): roll Chromium to r662092 (#4462)

This roll includes:
- [inspector_protocol:8ec18cf](8ec18cf088) Support STRING16 in the template when converting CBOR map keys
to protocol::Value.
- [inspector_protocol:37518ac](37518ac421) fix parsing of the last ASCII character

This fixes protocol handling of UTF8 in both V8 and Chromium.

Fixes #4443.
This commit is contained in:
Andrey Lushnikov 2019-05-22 21:21:45 +03:00 committed by GitHub
parent cbecfba0af
commit 76b24e64e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -132,11 +132,11 @@ class DOMWorld {
* @param {string} html
*/
async setContent(html) {
await this.evaluate(base64html => {
await this.evaluate(html => {
document.open();
document.write(decodeURIComponent(atob(base64html).split('').map(c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)).join('')));
document.write(html);
document.close();
}, Buffer.from(html).toString('base64'));
}, html);
}
/**

View File

@ -203,11 +203,11 @@ class DOMWorld {
} = options;
// We rely upon the fact that document.open() will reset frame lifecycle with "init"
// lifecycle event. @see https://crrev.com/608658
await this.evaluate(base64html => {
await this.evaluate(html => {
document.open();
document.write(decodeURIComponent(atob(base64html).split('').map(c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)).join('')));
document.write(html);
document.close();
}, Buffer.from(html).toString('base64'));
}, html);
const watcher = new LifecycleWatcher(this._frameManager, this._frame, waitUntil, timeout);
const error = await Promise.race([
watcher.timeoutOrTerminationPromise(),

View File

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

View File

@ -85,7 +85,7 @@ module.exports.addTests = function({testRunner, expect}) {
expect(await page.evaluate(a.sum, 1, 2)).toBe(3);
expect(await page.evaluate(a.mult, 2, 4)).toBe(8);
});
xit('should work with unicode chars', async({page, server}) => {
it('should work with unicode chars', async({page, server}) => {
const result = await page.evaluate(a => a['中文字符'], {'中文字符': 42});
expect(result).toBe(42);
});