chore(webdriver): support browser.userAgent (#12162)

This commit is contained in:
Alex Rudenko 2024-03-27 14:50:48 +01:00 committed by GitHub
parent 45f4df0a31
commit 6b7e3c6239
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 26 deletions

View File

@ -19,7 +19,6 @@ import {
import {BrowserContextEvent} from '../api/BrowserContext.js';
import type {Page} from '../api/Page.js';
import type {Target} from '../api/Target.js';
import {UnsupportedOperation} from '../common/Errors.js';
import {EventEmitter} from '../common/EventEmitter.js';
import {debugError} from '../common/util.js';
import type {Viewport} from '../common/Viewport.js';
@ -133,8 +132,8 @@ export class BidiBrowser extends Browser {
return !this.#browserName.toLocaleLowerCase().includes('firefox');
}
override userAgent(): never {
throw new UnsupportedOperation();
override async userAgent(): Promise<string> {
return this.#browserCore.session.capabilities.userAgent;
}
#createBrowserContext(userContext: UserContext) {

View File

@ -1012,20 +1012,6 @@
"expectations": ["SKIP"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[browser.spec] Browser specs Browser.userAgent should include Browser engine",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[browser.spec] Browser specs Browser.userAgent should include Browser engine",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should deny permission when not listed",
"platforms": ["darwin", "linux", "win32"],
@ -2341,13 +2327,6 @@
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should be able to launch Chrome",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should be able to launch Firefox",
"platforms": ["darwin", "linux", "win32"],
@ -3332,14 +3311,14 @@
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "headful"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
"comment": "only works in the old headless code"
},
{
"testIdPattern": "[pdf.spec] Page.pdf can print to PDF with outline",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "headless"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
"comment": "only works in the old headless code"
},
{
"testIdPattern": "[proxy.spec] request proxy in incognito browser context should proxy requests when configured at context level",