Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: promisify debugger.sendCommand() #16861

Merged
merged 2 commits into from Feb 13, 2019

Conversation

4 participants
@miniak
Copy link
Contributor

commented Feb 9, 2019

Description of Change

This PR promisifies debugger.sendCommand()

/cc @codebytere

Checklist

Release Notes

Notes: Converted debugger.sendCommand() to return a Promise instead of taking a callback.

@miniak miniak requested review from as code owners Feb 9, 2019

@miniak miniak requested a review from codebytere Feb 9, 2019

@miniak miniak self-assigned this Feb 9, 2019

@miniak miniak added target/5-0-x and removed target/5-0-x labels Feb 9, 2019

Show resolved Hide resolved atom/browser/api/atom_api_debugger.cc Outdated
Show resolved Hide resolved atom/browser/api/atom_api_debugger.cc Outdated

@miniak miniak force-pushed the miniak/promisify-debugger branch 3 times, most recently from 236e700 to a4e1ba5 Feb 13, 2019

@miniak miniak force-pushed the miniak/promisify-debugger branch from a4e1ba5 to a5fd283 Feb 13, 2019

@jkleinsc jkleinsc merged commit 1f458eb into master Feb 13, 2019

14 of 15 checks passed

Artifact Comparison Changes Detected
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-debug AppVeyor build succeeded
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-debug AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
electron-arm-testing Build #20190213.19 succeeded
Details
electron-arm64-testing Build #20190213.19 succeeded
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Feb 13, 2019

Release Notes Persisted

Converted debugger.sendCommand() to return a Promise instead of taking a callback.

@jkleinsc jkleinsc deleted the miniak/promisify-debugger branch Feb 13, 2019

@codebytere

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

/trop run backport-to 5-0-x

@trop

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2019

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "5-0-x" here we go! :D

@trop

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2019

I have automatically backported this PR to "5-0-x", please check out #16931

w.webContents.debugger.attach()

w.webContents.openDevTools()
await emittedOnce(w.webContents, 'devtools-opened')

This comment has been minimized.

Copy link
@nornagon

nornagon Feb 14, 2019

Contributor

🚨 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.

if (e) { reject(e) } else { resolve(r) }
})
})
const sendCommand = (...args) => w.webContents.debugger.sendCommand(...args)

This comment has been minimized.

Copy link
@nornagon

nornagon Feb 14, 2019

Contributor

Can probably just call w.webContents.debugger.sendCommand directly, or if that's too verbose then const {debugger} = w.webContents; debugger.sendCommand(...)

@sofianguy sofianguy added this to 5.0.0-beta.3 in 5.0.x Feb 18, 2019

@nornagon nornagon referenced this pull request Feb 22, 2019

Merged

test: fix race condition in debugger spec #17091

5 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.