feat(webkit): reload page after updating user agent (#268)

This commit is contained in:
Yury Semikhatsky 2019-12-16 18:29:40 -07:00 committed by GitHub
parent 68a03c2e84
commit bfb8df29bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -329,6 +329,7 @@ export class FrameManager implements PageDelegate {
async setUserAgent(userAgent: string): Promise<void> {
await this._setUserAgent(this._session, userAgent);
await this.reload();
}
async setJavaScriptEnabled(enabled: boolean): Promise<void> {

View File

@ -513,7 +513,7 @@ module.exports.addTests = function({testRunner, expect, headless, playwright, FF
]);
expect(request.headers['user-agent']).toBe('foobar');
});
it.skip(WEBKIT)('should emulate device user-agent', async({page, server}) => {
it('should emulate device user-agent', async({page, server}) => {
await page.goto(server.PREFIX + '/mobile.html');
expect(await page.evaluate(() => navigator.userAgent)).not.toContain('iPhone');
await page.setUserAgent(playwright.devices['iPhone 6'].userAgent);