зеркало из https://github.com/electron/electron.git
standardize more
This commit is contained in:
Родитель
9db733a4ff
Коммит
5e4696f4a7
|
@ -30,7 +30,7 @@ describe('debugger module', function () {
|
|||
w.webContents.openDevTools()
|
||||
try {
|
||||
w.webContents.debugger.attach()
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
assert(w.webContents.debugger.isAttached())
|
||||
done()
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ describe('debugger module', function () {
|
|||
it('fails when protocol version is not supported', function (done) {
|
||||
try {
|
||||
w.webContents.debugger.attach('2.0')
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
assert(!w.webContents.debugger.isAttached())
|
||||
done()
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ describe('debugger module', function () {
|
|||
it('attaches when no protocol version is specified', function (done) {
|
||||
try {
|
||||
w.webContents.debugger.attach()
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
done('unexpected error : ' + err)
|
||||
}
|
||||
assert(w.webContents.debugger.isAttached())
|
||||
|
@ -67,7 +67,7 @@ describe('debugger module', function () {
|
|||
})
|
||||
try {
|
||||
w.webContents.debugger.attach()
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
done('unexpected error : ' + err)
|
||||
}
|
||||
w.webContents.debugger.detach()
|
||||
|
@ -79,7 +79,7 @@ describe('debugger module', function () {
|
|||
w.webContents.loadURL('about:blank')
|
||||
try {
|
||||
w.webContents.debugger.attach()
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
done('unexpected error : ' + err)
|
||||
}
|
||||
var callback = function (err, res) {
|
||||
|
@ -101,7 +101,7 @@ describe('debugger module', function () {
|
|||
w.webContents.loadURL(url)
|
||||
try {
|
||||
w.webContents.debugger.attach()
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
done('unexpected error : ' + err)
|
||||
}
|
||||
w.webContents.debugger.on('message', function (e, method, params) {
|
||||
|
@ -120,7 +120,7 @@ describe('debugger module', function () {
|
|||
w.webContents.loadURL('about:blank')
|
||||
try {
|
||||
w.webContents.debugger.attach()
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
done('unexpected error : ' + err)
|
||||
}
|
||||
w.webContents.debugger.sendCommand('Test', function (err) {
|
||||
|
|
|
@ -45,7 +45,7 @@ describe('nativeImage module', () => {
|
|||
assert.equal(nsimage.length, 8)
|
||||
|
||||
// If all bytes are null, that's Bad
|
||||
assert.equal(nsimage.reduce((acc, x) => acc || (x != 0), false), true)
|
||||
assert.equal(nsimage.reduce((acc, x) => acc || (x !== 0), false), true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -183,7 +183,7 @@ describe('protocol module', function () {
|
|||
|
||||
it('fails when sending object other than string', function (done) {
|
||||
var handler = function (request, callback) {
|
||||
callback(new Date)
|
||||
callback(new Date())
|
||||
}
|
||||
protocol.registerBufferProtocol(protocolName, handler, function (error) {
|
||||
if (error) {
|
||||
|
@ -413,7 +413,7 @@ describe('protocol module', function () {
|
|||
|
||||
it('fails when sending unsupported content', function (done) {
|
||||
var handler = function (request, callback) {
|
||||
callback(new Date)
|
||||
callback(new Date())
|
||||
}
|
||||
protocol.registerBufferProtocol(protocolName, handler, function (error) {
|
||||
if (error) {
|
||||
|
@ -491,7 +491,7 @@ describe('protocol module', function () {
|
|||
|
||||
it('fails when sending unsupported content', function (done) {
|
||||
var handler = function (request, callback) {
|
||||
callback(new Date)
|
||||
callback(new Date())
|
||||
}
|
||||
protocol.registerHttpProtocol(protocolName, handler, function (error) {
|
||||
if (error) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* globals WebView */
|
||||
|
||||
const assert = require('assert')
|
||||
const http = require('http')
|
||||
const path = require('path')
|
||||
|
@ -231,7 +233,7 @@ describe('session module', function () {
|
|||
downloadServer.listen(0, '127.0.0.1', function () {
|
||||
var port = downloadServer.address().port
|
||||
ipcRenderer.sendSync('set-download-option', false, false)
|
||||
var webview = new WebView
|
||||
var webview = new WebView()
|
||||
webview.src = 'file://' + fixtures + '/api/blank.html'
|
||||
webview.addEventListener('did-finish-load', function () {
|
||||
webview.downloadURL(url + ':' + port + '/')
|
||||
|
|
|
@ -18,7 +18,7 @@ describe('asar package', function () {
|
|||
describe('fs.readFileSync', function () {
|
||||
it('does not leak fd', function () {
|
||||
var readCalls = 1
|
||||
while(readCalls <= 10000) {
|
||||
while (readCalls <= 10000) {
|
||||
fs.readFileSync(path.join(process.resourcesPath, 'atom.asar', 'renderer', 'api', 'ipc.js'))
|
||||
readCalls++
|
||||
}
|
||||
|
@ -530,9 +530,9 @@ describe('asar package', function () {
|
|||
describe('fs.mkdirSync', function () {
|
||||
it('throws error when calling inside asar archive', function () {
|
||||
var p = path.join(fixtures, 'asar', 'a.asar', 'not-exist')
|
||||
assert.throws((function () {
|
||||
assert.throws(function () {
|
||||
fs.mkdirSync(p)
|
||||
}), new RegExp('ENOTDIR'))
|
||||
}, new RegExp('ENOTDIR'))
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -103,10 +103,11 @@ describe('chromium feature', function () {
|
|||
navigator.mediaDevices.enumerateDevices().then((devices) => {
|
||||
const labels = devices.map((device) => device.label)
|
||||
const labelFound = labels.some((label) => !!label)
|
||||
if (labelFound)
|
||||
if (labelFound) {
|
||||
done()
|
||||
else
|
||||
} else {
|
||||
done('No device labels found: ' + JSON.stringify(labels))
|
||||
}
|
||||
}).catch(done)
|
||||
})
|
||||
})
|
||||
|
@ -171,8 +172,9 @@ describe('chromium feature', function () {
|
|||
it('inherit options of parent window', function (done) {
|
||||
var b
|
||||
listener = function (event) {
|
||||
var height, ref1, width
|
||||
ref1 = remote.getCurrentWindow().getSize(), width = ref1[0], height = ref1[1]
|
||||
var ref1 = remote.getCurrentWindow().getSize()
|
||||
var width = ref1[0]
|
||||
var height = ref1[1]
|
||||
assert.equal(event.data, 'size: ' + width + ' ' + height)
|
||||
b.close()
|
||||
done()
|
||||
|
|
Загрузка…
Ссылка в новой задаче