chore: BiDi close error (#10687)

This commit is contained in:
Nikolay Vitkov 2023-08-04 14:45:38 +02:00 committed by GitHub
parent 4a0a2bb2db
commit f4c711e25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 8 deletions

View File

@ -394,6 +394,10 @@ export class Page extends PageBase {
return this.#networkManager.getNavigationResponse(id);
}
override isClosed(): boolean {
return this.#closedDeferred.finished();
}
override async close(): Promise<void> {
if (this.#closedDeferred.finished()) {
return;

View File

@ -71,6 +71,12 @@
"parameters": [],
"expectations": ["PASS"]
},
{
"testIdPattern": "[injected.spec] PuppeteerUtil tests *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[jshandle.spec] *",
"platforms": ["darwin", "linux", "win32"],
@ -1181,6 +1187,18 @@
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.close should set the page close state",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.close should terminate network waiters",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.Events.Close should work with page.close",
"platforms": ["darwin", "linux", "win32"],
@ -3964,11 +3982,5 @@
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "chrome", "headless"],
"expectations": ["FAIL", "PASS"]
},
{
"testIdPattern": "[injected.spec] PuppeteerUtil tests *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
}
]

View File

@ -107,7 +107,10 @@ describe('Launcher specs', function () {
]);
for (let i = 0; i < 2; i++) {
const message = results[i].message;
expect(message).toContain('Target closed');
expect(message).atLeastOneToContain([
'Target closed',
'Page closed!',
]);
expect(message).not.toContain('Timeout');
}
} finally {

View File

@ -110,7 +110,7 @@ describe('Page', function () {
]);
for (let i = 0; i < 2; i++) {
const message = results[i].message;
expect(message).toContain('Target closed');
expect(message).atLeastOneToContain(['Target closed', 'Page closed!']);
expect(message).not.toContain('Timeout');
}
});