This commit is contained in:
Felix Rieseberg 2017-11-23 14:22:43 -08:00
Π ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒ 0278e380de
ΠšΠΎΠΌΠΌΠΈΡ‚ 9f0df695ca
13 ΠΈΠ·ΠΌΠ΅Π½Ρ‘Π½Π½Ρ‹Ρ… Ρ„Π°ΠΉΠ»ΠΎΠ²: 49 Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠΉ ΠΈ 5 ΡƒΠ΄Π°Π»Π΅Π½ΠΈΠΉ

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -153,7 +153,7 @@ describe('BrowserWindow module', () => {
]
const responseEvent = 'window-webContents-destroyed'
function* genNavigationEvent () {
function * genNavigationEvent () {
let eventOptions = null
while ((eventOptions = events.shift()) && events.length) {
let w = new BrowserWindow({show: false})
@ -1056,6 +1056,8 @@ describe('BrowserWindow module', () => {
// http protocol to simulate accessing another domain. This is required
// because the code paths for cross domain popups is different.
function crossDomainHandler (request, callback) {
// Disabled due to false positive in StandardJS
// eslint-disable-next-line standard/no-callback-literal
callback({
mimeType: 'text/html',
data: `<html><body><h1>${request.url}</h1></body></html>`
@ -3025,6 +3027,8 @@ const isScaleFactorRounding = () => {
function serveFileFromProtocol (protocolName, filePath) {
return new Promise((resolve, reject) => {
protocol.registerBufferProtocol(protocolName, (request, callback) => {
// Disabled due to false positive in StandardJS
// eslint-disable-next-line standard/no-callback-literal
callback({
mimeType: 'text/html',
data: fs.readFileSync(filePath)

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -195,6 +195,7 @@ describe('ipc module', () => {
const foo = remote.require(path.join(fixtures, 'module', 'error-properties.js'))
assert.throws(() => {
// eslint-disable-next-line
foo.bar
}, /getting error/)

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -1,5 +1,7 @@
'use strict'
/* eslint-disable no-unused-expressions */
const {expect} = require('chai')
const {nativeImage} = require('electron')
const path = require('path')

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -6,6 +6,9 @@ const url = require('url')
const {net} = remote
const {session} = remote
/* The whole net API doesn't use standard callbacks */
/* eslint-disable standard/no-callback-literal */
function randomBuffer (size, start, end) {
start = start || 0
end = end || 255
@ -855,6 +858,8 @@ describe('net module', () => {
(details, callback) => {
if (details.url === `${server.url}${requestUrl}`) {
requestIsIntercepted = true
// Disabled due to false positive in StandardJS
// eslint-disable-next-line standard/no-callback-literal
callback({
redirectURL: `${server.url}${redirectUrl}`
})
@ -907,6 +912,8 @@ describe('net module', () => {
customSession.webRequest.onBeforeRequest((details, callback) => {
if (details.url === `${server.url}${requestUrl}`) {
requestIsIntercepted = true
// Disabled due to false positive in StandardJS
// eslint-disable-next-line standard/no-callback-literal
callback({
redirectURL: `${server.url}${redirectUrl}`
})
@ -1154,6 +1161,8 @@ describe('net module', () => {
url: `${server.url}${requestUrl}`,
session: 1
})
// eslint-disable-next-line
urlRequest
} catch (exception) {
done()
@ -1223,6 +1232,8 @@ describe('net module', () => {
url: `${server.url}${requestUrl}`,
partition: 1
})
// eslint-disable-next-line
urlRequest
} catch (exception) {
done()

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -10,6 +10,9 @@ const {BrowserWindow, ipcMain, protocol, session, webContents} = remote
// and use Stream instances created in the browser process.
const stream = remote.require('stream')
/* The whole protocol API doesn't use standard callbacks */
/* eslint-disable standard/no-callback-literal */
describe('protocol module', () => {
const protocolName = 'sp'
const text = 'valar morghulis'

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -10,6 +10,9 @@ const {closeWindow} = require('./window-helpers')
const {ipcRenderer, remote} = require('electron')
const {ipcMain, session, BrowserWindow, net} = remote
/* The whole session API doesn't use standard callbacks */
/* eslint-disable standard/no-callback-literal */
describe('session module', () => {
let fixtures = path.resolve(__dirname, 'fixtures')
let w = null

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -10,6 +10,9 @@ const {BrowserWindow, webContents, ipcMain, session} = remote
const isCi = remote.getGlobal('isCi')
/* The whole webContents API doesn't use standard callbacks */
/* eslint-disable standard/no-callback-literal */
describe('webContents module', () => {
const fixtures = path.resolve(__dirname, 'fixtures')
let w
@ -634,7 +637,7 @@ describe('webContents module', () => {
]
const responseEvent = 'webcontents-destroyed'
function* genNavigationEvent () {
function * genNavigationEvent () {
let eventOptions = null
while ((eventOptions = events.shift()) && events.length) {
eventOptions.responseEvent = responseEvent

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -4,6 +4,9 @@ const {closeWindow} = require('./window-helpers')
const {remote, webFrame} = require('electron')
const {BrowserWindow, protocol, ipcMain} = remote
/* Most of the APIs here don't use standard callbacks */
/* eslint-disable standard/no-callback-literal */
describe('webFrame module', function () {
var fixtures = path.resolve(__dirname, 'fixtures')
var w = null

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -4,6 +4,9 @@ const qs = require('querystring')
const remote = require('electron').remote
const session = remote.session
/* The whole webRequest API doesn't use standard callbacks */
/* eslint-disable standard/no-callback-literal */
describe('webRequest module', () => {
const ses = session.defaultSession
const server = http.createServer((req, res) => {

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -11,6 +11,9 @@ const {app, BrowserWindow, ipcMain, protocol, session, webContents} = remote
const isCI = remote.getGlobal('isCi')
/* Most of the APIs here don't use standard callbacks */
/* eslint-disable standard/no-callback-literal */
describe('chromium feature', () => {
const fixtures = path.resolve(__dirname, 'fixtures')
let listener = null

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -298,6 +298,7 @@ describe('node feature', () => {
describe('process.stdout', () => {
it('does not throw an exception when accessed', () => {
assert.doesNotThrow(() => {
// eslint-disable-next-line
process.stdout
})
})
@ -332,7 +333,7 @@ describe('node feature', () => {
describe('process.stdin', () => {
it('does not throw an exception when accessed', () => {
assert.doesNotThrow(() => {
process.stdin
process.stdin // eslint-disable-line
})
})

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -32,9 +32,11 @@ app.commandLine.appendSwitch('disable-renderer-backgrounding')
// Accessing stdout in the main process will result in the process.stdout
// throwing UnknownSystemError in renderer process sometimes. This line makes
// sure we can reproduce it in renderer process.
// eslint-disable-next-line
process.stdout
// Access console to reproduce #3482.
// eslint-disable-next-line
console
ipcMain.on('message', function (event, ...args) {
@ -378,6 +380,8 @@ const suspendListeners = (emitter, eventName, callback) => {
listeners.forEach((listener) => {
emitter.on(eventName, listener)
})
// eslint-disable-next-line standard/no-callback-literal
callback(...args)
})
}

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -9,6 +9,9 @@ const {closeWindow} = require('./window-helpers')
const isCI = remote.getGlobal('isCi')
const nativeModulesEnabled = remote.getGlobal('nativeModulesEnabled')
/* Most of the APIs here don't use standard callbacks */
/* eslint-disable standard/no-callback-literal */
describe('<webview> tag', function () {
this.timeout(3 * 60 * 1000)
@ -1423,7 +1426,7 @@ describe('<webview> tag', function () {
})
webview.style.display = 'none'
webview.offsetHeight
webview.offsetHeight // eslint-disable-line
webview.style.display = 'block'
})
webview.src = `file://${fixtures}/pages/a.html`
@ -1442,7 +1445,7 @@ describe('<webview> tag', function () {
})
webview.style.display = 'none'
webview.offsetHeight
webview.offsetHeight // eslint-disable-line
webview.style.display = 'block'
})
webview.src = `file://${fixtures}/pages/a.html`