Roll chromium to r493673 (#240)
Mouse events are no longer racy. Enabling touch no longer converts all mouse events into touches. Promises in destroyed execution contexts are rejected immediately.
This commit is contained in:
parent
b8dbd28b8c
commit
497baf0198
@ -454,6 +454,11 @@ class WaitTask {
|
|||||||
if (!success && !error)
|
if (!success && !error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// When the page is navigated, the promise is rejected.
|
||||||
|
// We will try again in the new execution context.
|
||||||
|
if (error && error.message.includes('Execution context was destroyed'))
|
||||||
|
return;
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
this._reject(error);
|
this._reject(error);
|
||||||
else
|
else
|
||||||
|
12
lib/Input.js
12
lib/Input.js
@ -120,7 +120,6 @@ class Mouse {
|
|||||||
x, y,
|
x, y,
|
||||||
modifiers: this._keyboard._modifiers
|
modifiers: this._keyboard._modifiers
|
||||||
});
|
});
|
||||||
await this._doubleRaf();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -136,15 +135,6 @@ class Mouse {
|
|||||||
await this.up(options);
|
await this.up(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
async _doubleRaf() {
|
|
||||||
// This is a hack for now, to make clicking less race-prone. See crbug.com/747647
|
|
||||||
await this._client.send('Runtime.evaluate', {
|
|
||||||
expression: 'new Promise(f => requestAnimationFrame(() => requestAnimationFrame(f)))',
|
|
||||||
awaitPromise: true,
|
|
||||||
returnByValue: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!Object=} options
|
* @param {!Object=} options
|
||||||
*/
|
*/
|
||||||
@ -160,7 +150,6 @@ class Mouse {
|
|||||||
modifiers: this._keyboard._modifiers,
|
modifiers: this._keyboard._modifiers,
|
||||||
clickCount: (options.clickCount || 1)
|
clickCount: (options.clickCount || 1)
|
||||||
});
|
});
|
||||||
await this._doubleRaf();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -178,7 +167,6 @@ class Mouse {
|
|||||||
modifiers: this._keyboard._modifiers,
|
modifiers: this._keyboard._modifiers,
|
||||||
clickCount: (options.clickCount || 1)
|
clickCount: (options.clickCount || 1)
|
||||||
});
|
});
|
||||||
await this._doubleRaf();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
"ws": "^3.0.0"
|
"ws": "^3.0.0"
|
||||||
},
|
},
|
||||||
"puppeteer": {
|
"puppeteer": {
|
||||||
"chromium_revision": "492629"
|
"chromium_revision": "493673"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"commonmark": "^0.27.0",
|
"commonmark": "^0.27.0",
|
||||||
|
@ -961,7 +961,7 @@ describe('Page', function() {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
// @see https://github.com/GoogleChrome/puppeteer/issues/161
|
// @see https://github.com/GoogleChrome/puppeteer/issues/161
|
||||||
xit('should not hang with touch-enabled viewports', SX(async function() {
|
it('should not hang with touch-enabled viewports', SX(async function() {
|
||||||
await page.setViewport(iPhone.viewport);
|
await page.setViewport(iPhone.viewport);
|
||||||
await page.mouse.down();
|
await page.mouse.down();
|
||||||
await page.mouse.move(100, 10);
|
await page.mouse.move(100, 10);
|
||||||
@ -1209,7 +1209,7 @@ describe('Page', function() {
|
|||||||
expect(await page.evaluate(() => window.lastEvent.repeat)).toBe(true);
|
expect(await page.evaluate(() => window.lastEvent.repeat)).toBe(true);
|
||||||
}));
|
}));
|
||||||
// @see https://github.com/GoogleChrome/puppeteer/issues/206
|
// @see https://github.com/GoogleChrome/puppeteer/issues/206
|
||||||
xit('should click links which cause navigation', SX(async function() {
|
it('should click links which cause navigation', SX(async function() {
|
||||||
await page.setContent(`<a href="${EMPTY_PAGE}">empty.html</a>`);
|
await page.setContent(`<a href="${EMPTY_PAGE}">empty.html</a>`);
|
||||||
// This await should not hang.
|
// This await should not hang.
|
||||||
await page.click('a');
|
await page.click('a');
|
||||||
|
Loading…
Reference in New Issue
Block a user