Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add experimental browser.debugInfo (#11748)
- Loading branch information
Showing
12 changed files
with
135 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
sidebar_label: DebugInfo | ||
--- | ||
|
||
# DebugInfo interface | ||
|
||
#### Signature: | ||
|
||
```typescript | ||
export interface DebugInfo | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | Default | | ||
| --------------------- | --------- | --------- | ----------- | ------- | | ||
| pendingProtocolErrors | | Error\[\] | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* @license | ||
* Copyright 2024 Google Inc. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import expect from 'expect'; | ||
|
||
import {getTestState, setupTestBrowserHooks} from './mocha-utils.js'; | ||
|
||
describe('DebugInfo', function () { | ||
setupTestBrowserHooks(); | ||
|
||
describe('Browser.debugInfo', function () { | ||
it('should work', async () => { | ||
const {page, browser} = await getTestState(); | ||
|
||
const promise = page.evaluate(() => { | ||
return new Promise(resolve => { | ||
// @ts-expect-error another context | ||
window.resolve = resolve; | ||
}); | ||
}); | ||
try { | ||
expect(browser.debugInfo.pendingProtocolErrors).toHaveLength(1); | ||
} finally { | ||
await page.evaluate(() => { | ||
// @ts-expect-error another context | ||
window.resolve(); | ||
}); | ||
} | ||
await promise; | ||
expect(browser.debugInfo.pendingProtocolErrors).toHaveLength(0); | ||
}); | ||
}); | ||
}); |