Skip to content

Commit

Permalink
feat(chromium): roll Chromium to r662092 (puppeteer#4462)
Browse files Browse the repository at this point in the history
This roll includes:
- [inspector_protocol:8ec18cf](https://chromium.googlesource.com/deps/inspector_protocol/+/8ec18cf0885bef0b5c2a922c5dc3813cbf63e962) Support STRING16 in the template when converting CBOR map keys
to protocol::Value.
- [inspector_protocol:37518ac](https://chromium.googlesource.com/deps/inspector_protocol/+/37518ac4214de146d39e324060a20b2e78673c53) fix parsing of the last ASCII character

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

Fixes puppeteer#4443.
  • Loading branch information
aslushnikov authored May 22, 2019
1 parent cbecfba commit 76b24e6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions experimental/puppeteer-firefox/lib/DOMWorld.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/DOMWorld.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
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": "656675"
"chromium_revision": "662092"
},
"scripts": {
"unit": "node test/test.js",
Expand Down
2 changes: 1 addition & 1 deletion test/evaluation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 76b24e6

Please sign in to comment.