standardize by hand

This commit is contained in:
Zeke Sikelianos 2016-03-28 17:16:08 -07:00 committed by Kevin Sawicki
parent fd0f9519f1
commit cfdfdc8ccc
2 changed files with 16 additions and 18 deletions

View file

@ -1,3 +1,5 @@
/* globals Event, HTMLObjectElement */
'use strict'
const deprecate = require('electron').deprecate
@ -72,7 +74,7 @@ var WebViewImpl = (function () {
this.beforeFirstNavigation = true
this.attributes[webViewConstants.ATTRIBUTE_PARTITION].validPartitionId = true
}
return this.internalInstanceId = 0
this.internalInstanceId = 0
}
// Sets the <webview>.request property.
@ -267,7 +269,7 @@ var registerBrowserPluginElement = function () {
this.setAttribute('id', 'browser-plugin-' + getNextId())
// The <object> node fills in the <webview> container.
return this.style.flex = '1 1 auto'
this.style.flex = '1 1 auto'
}
proto.attributeChangedCallback = function (name, oldValue, newValue) {
var internal
@ -374,7 +376,7 @@ var registerWebViewElement = function () {
'downloadURL',
'inspectServiceWorker',
'print',
'printToPDF',
'printToPDF'
]
nonblockMethods = [
'insertCSS',
@ -383,7 +385,7 @@ var registerWebViewElement = function () {
'sendInputEvent',
'setZoomFactor',
'setZoomLevel',
'setZoomLevelLimits',
'setZoomLevelLimits'
]
// Forward proto.foo* method calls to WebViewImpl.foo*.

View file

@ -87,9 +87,9 @@ describe('browser-window module', function () {
it('prevents users to access methods of webContents', function () {
var webContents = w.webContents
w.destroy()
assert.throws((function () {
assert.throws(function () {
webContents.getId()
}), /Object has been destroyed/)
}, /Object has been destroyed/)
})
})
@ -522,8 +522,7 @@ describe('browser-window module', function () {
w.loadURL('file://' + fixtures + '/api/blank.html')
w.webContents.beginFrameSubscription(function (data) {
// This callback might be called twice.
if (called)
return
if (called) return
called = true
assert.notEqual(data.length, 0)
@ -595,8 +594,7 @@ describe('browser-window module', function () {
describe('window states (excluding Linux)', function () {
// Not implemented on Linux.
if (process.platform == 'linux')
return
if (process.platform === 'linux') return
describe('movable state', function () {
it('can be changed with movable option', function () {
@ -657,8 +655,7 @@ describe('browser-window module', function () {
describe('fullscreenable state', function () {
// Only implemented on OS X.
if (process.platform != 'darwin')
return
if (process.platform !== 'darwin') return
it('can be changed with fullscreenable option', function () {
w.destroy()
@ -696,14 +693,13 @@ describe('browser-window module', function () {
// dynamically.
it('can be changed with hasShadow option', function () {
w.destroy()
let hasShadow = process.platform == 'darwin' ? false : true
let hasShadow = process.platform !== 'darwin'
w = new BrowserWindow({show: false, hasShadow: hasShadow})
assert.equal(w.hasShadow(), hasShadow)
})
it('can be changed with setHasShadow method', function () {
if (process.platform != 'darwin')
return
if (process.platform !== 'darwin') return
assert.equal(w.hasShadow(), true)
w.setHasShadow(false)
@ -763,19 +759,19 @@ describe('browser-window module', function () {
describe('deprecated options', function () {
it('throws a deprecation error for option keys using hyphens instead of camel case', function () {
assert.throws(function () {
new BrowserWindow({'min-width': 500})
new BrowserWindow({'min-width': 500}) // eslint-disable-line
}, 'min-width is deprecated. Use minWidth instead.')
})
it('throws a deprecation error for webPreference keys using hyphens instead of camel case', function () {
assert.throws(function () {
new BrowserWindow({webPreferences: {'node-integration': false}})
new BrowserWindow({webPreferences: {'node-integration': false}}) // eslint-disable-line
}, 'node-integration is deprecated. Use nodeIntegration instead.')
})
it('throws a deprecation error for option keys that should be set on webPreferences', function () {
assert.throws(function () {
new BrowserWindow({zoomFactor: 1})
new BrowserWindow({zoomFactor: 1}) // eslint-disable-line
}, 'options.zoomFactor is deprecated. Use options.webPreferences.zoomFactor instead.')
})
})