-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an experimental method that would provide debugging information to help debug issues with Puppeteer. Currently, it only provides the stacktraces for pending protocol calls.
- Loading branch information
Showing
9 changed files
with
112 additions
and
0 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
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.only('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); | ||
}); | ||
}); | ||
}); |