mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: unskip csp tests (#10960)
This commit is contained in:
parent
7aa3063acd
commit
a4f13b53af
@ -10,7 +10,7 @@ Toggles bypassing page's Content-Security-Policy.
|
||||
|
||||
```typescript
|
||||
class Page {
|
||||
setBypassCSP(enabled: boolean): Promise<void>;
|
||||
abstract setBypassCSP(enabled: boolean): Promise<void>;
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -1904,10 +1904,7 @@ export abstract class Page extends EventEmitter<PageEvents> {
|
||||
* evaluation. Usually, this means that `page.setBypassCSP` should be called
|
||||
* before navigating to the domain.
|
||||
*/
|
||||
async setBypassCSP(enabled: boolean): Promise<void>;
|
||||
async setBypassCSP(): Promise<void> {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
abstract setBypassCSP(enabled: boolean): Promise<void>;
|
||||
|
||||
/**
|
||||
* @param type - Changes the CSS media type of the page. The only allowed
|
||||
|
@ -155,17 +155,6 @@ export class BidiPage extends Page {
|
||||
return this.mainFrame().context().cdpSession;
|
||||
}
|
||||
|
||||
override async setUserAgent(
|
||||
userAgent: string,
|
||||
userAgentMetadata?: Protocol.Emulation.UserAgentMetadata | undefined
|
||||
): Promise<void> {
|
||||
// TODO: handle CDP-specific cases such as mprach.
|
||||
await this._client().send('Network.setUserAgentOverride', {
|
||||
userAgent: userAgent,
|
||||
userAgentMetadata: userAgentMetadata,
|
||||
});
|
||||
}
|
||||
|
||||
constructor(
|
||||
browsingContext: BrowsingContext,
|
||||
browserContext: BidiBrowserContext
|
||||
@ -214,6 +203,22 @@ export class BidiPage extends Page {
|
||||
this.#keyboard = new BidiKeyboard(this.mainFrame().context());
|
||||
}
|
||||
|
||||
override async setUserAgent(
|
||||
userAgent: string,
|
||||
userAgentMetadata?: Protocol.Emulation.UserAgentMetadata | undefined
|
||||
): Promise<void> {
|
||||
// TODO: handle CDP-specific cases such as mprach.
|
||||
await this._client().send('Network.setUserAgentOverride', {
|
||||
userAgent: userAgent,
|
||||
userAgentMetadata: userAgentMetadata,
|
||||
});
|
||||
}
|
||||
|
||||
override async setBypassCSP(enabled: boolean): Promise<void> {
|
||||
// TODO: handle CDP-specific cases such as mprach.
|
||||
await this._client().send('Page.setBypassCSP', {enabled});
|
||||
}
|
||||
|
||||
_setBrowserContext(browserContext: BidiBrowserContext): void {
|
||||
this.#browserContext = browserContext;
|
||||
}
|
||||
|
@ -3455,24 +3455,48 @@
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.setBypassCSP should bypass after cross-process navigation",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["chrome", "webDriverBiDi"],
|
||||
"expectations": ["PASS"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.setBypassCSP should bypass CSP header",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.setBypassCSP should bypass CSP header",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["chrome", "webDriverBiDi"],
|
||||
"expectations": ["PASS"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.setBypassCSP should bypass CSP in iframes as well",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.setBypassCSP should bypass CSP in iframes as well",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["chrome", "webDriverBiDi"],
|
||||
"expectations": ["PASS"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.setBypassCSP should bypass CSP meta tag",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["cdp", "firefox"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.setBypassCSP should bypass CSP meta tag",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["chrome", "webDriverBiDi"],
|
||||
"expectations": ["PASS"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[page.spec] Page Page.setCacheEnabled should enable or disable the cache based on the state passed",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
|
Loading…
Reference in New Issue
Block a user