Repository navigation
feat: promisify debugger.sendCommand() - #16861
Merged
Merged
Conversation
codebytere
requested changes
Feb 13, 2019
miniak
force-pushed
the
miniak/promisify-debugger
branch
3 times, most recently
from
February 13, 2019 09:12
236e700 to
a4e1ba5
Compare
miniak
force-pushed
the
miniak/promisify-debugger
branch
from
February 13, 2019 09:12
a4e1ba5 to
a5fd283
Compare
codebytere
approved these changes
Feb 13, 2019
|
Release Notes Persisted
|
Member
|
/trop run backport-to 5-0-x |
Contributor
|
The backport process for this PR has been manually initiated, |
Contributor
|
I have automatically backported this PR to "5-0-x", please check out #16931 |
nornagon
reviewed
Feb 14, 2019
| w.webContents.debugger.attach() | ||
|
|
||
| w.webContents.openDevTools() | ||
| await emittedOnce(w.webContents, 'devtools-opened') |
Contributor
There was a problem hiding this comment.
🚨 FLAKE ALERT 🚨
you need to call emittedOnce before you call openDevTools. As written this is a race condition and will result in a flaky test.
nornagon
reviewed
Feb 14, 2019
| if (e) { reject(e) } else { resolve(r) } | ||
| }) | ||
| }) | ||
| const sendCommand = (...args) => w.webContents.debugger.sendCommand(...args) |
Contributor
There was a problem hiding this comment.
Can probably just call w.webContents.debugger.sendCommand directly, or if that's too verbose then const {debugger} = w.webContents; debugger.sendCommand(...)
5 tasks done
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
This PR promisifies
debugger.sendCommand()/cc @codebytere
Checklist
npm testpassesRelease Notes
Notes: Converted
debugger.sendCommand()to return a Promise instead of taking a callback.