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

[WIP] chore: test to see if #19986 really solved #19422. #20018

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 22 additions & 20 deletions spec/chromium-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,29 @@ describe('chromium feature', () => {
})

describe('--remote-debugging-port switch', () => {
it('should display the discovery page', (done) => {
const electronPath = remote.getGlobal('process').execPath
let output = ''
const appProcess = ChildProcess.spawn(electronPath, [`--remote-debugging-port=`])

appProcess.stderr.on('data', (data) => {
output += data
const m = /DevTools listening on ws:\/\/127.0.0.1:(\d+)\//.exec(output)
if (m) {
appProcess.stderr.removeAllListeners('data')
const port = m[1]
http.get(`http://127.0.0.1:${port}`, (res) => {
res.destroy()
appProcess.kill()
expect(res.statusCode).to.eql(200)
expect(parseInt(res.headers['content-length'])).to.be.greaterThan(0)
done()
})
}
for (let i = 0; i < 100; ++i) {
it('should display the discovery page', (done) => {
const electronPath = remote.getGlobal('process').execPath
let output = ''
const appProcess = ChildProcess.spawn(electronPath, [`--remote-debugging-port=`])

appProcess.stderr.on('data', (data) => {
output += data
const m = /DevTools listening on ws:\/\/127.0.0.1:(\d+)\//.exec(output)
if (m) {
appProcess.stderr.removeAllListeners('data')
const port = m[1]
http.get(`http://127.0.0.1:${port}`, (res) => {
res.destroy()
appProcess.kill()
expect(res.statusCode).to.eql(200)
expect(parseInt(res.headers['content-length'])).to.be.greaterThan(0)
done()
})
}
})
})
})
}
})
})

Expand Down