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(deps): electron@9.0.5 #7791

Merged
merged 13 commits into from Jun 29, 2020
Merged
2 changes: 1 addition & 1 deletion .node-version
@@ -1 +1 @@
12.8.1
12.14.1
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -7,7 +7,7 @@ branches:
# https://www.appveyor.com/docs/lang/nodejs-iojs/
environment:
# use matching version of Node.js
nodejs_version: "12.8.1"
nodejs_version: "12.14.1"
# encode secure variables which will NOT be used
# in pull requests
# https://www.appveyor.com/docs/build-configuration/#secure-variables
Expand Down
11 changes: 7 additions & 4 deletions circle.yml
Expand Up @@ -43,14 +43,14 @@ executors:
# the Docker image with Cypress dependencies and Chrome browser
cy-doc:
docker:
- image: cypress/browsers:node12.13.0-chrome80-ff74
- image: cypress/browsers:node12.14.1-chrome83-ff77
environment:
PLATFORM: linux

# Docker image with non-root "node" user
non-root-docker-user:
docker:
- image: cypress/browsers:node12.13.0-chrome80-ff74
- image: cypress/browsers:node12.14.1-chrome83-ff77
user: node
environment:
PLATFORM: linux
Expand All @@ -60,8 +60,8 @@ executors:
# https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
mac:
macos:
## Node 12.10.0 (yarn 1.17.3)
xcode: "11.0.0"
## Node 12.12.0 (yarn 1.19.1)
xcode: "11.2.1"
environment:
PLATFORM: mac

Expand Down Expand Up @@ -1102,6 +1102,9 @@ jobs:
- run: mkdir test-binary
- run: node --version
- run: npm --version
# TODO: this can be removed as soon as the minimum Node version is bumped to 10
# see https://github.com/cypress-io/cypress-docker-images/pull/332
- run: apt-get update && apt-get install -y libgbm-dev
- run:
name: Create new NPM package
working_directory: test-binary
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -187,7 +187,7 @@
"typescript": "3.7.4"
},
"engines": {
"node": ">=12.8.1",
"node": ">=12.14.1",
"yarn": ">=1.17.3"
},
"productName": "Cypress",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron/package.json
Expand Up @@ -24,7 +24,7 @@
"minimist": "1.2.5"
},
"devDependencies": {
"electron": "8.3.1",
"electron": "9.0.5",
"mocha": "3.5.3"
},
"files": [
Expand Down
16 changes: 8 additions & 8 deletions packages/server/lib/browsers/electron.js
Expand Up @@ -66,12 +66,12 @@ const _getAutomation = function (win, options) {
return automation
}

const _installExtensions = function (extensionPaths = [], options) {
Windows.removeAllExtensions()
const _installExtensions = function (win, extensionPaths = [], options) {
Windows.removeAllExtensions(win)

return extensionPaths.forEach((path) => {
return Bluebird.map(extensionPaths, (path) => {
try {
return Windows.installExtension(path)
return Windows.installExtension(win, path)
} catch (error) {
return options.onWarning(errors.get('EXTENSION_NOT_LOADED', 'Electron', path))
}
Expand Down Expand Up @@ -349,10 +349,10 @@ module.exports = {

debug('launching browser window to url: %s', url)

_installExtensions(launchOptions.extensions, options)

return this._render(url, projectRoot, automation, preferences)
.then((win) => {
.then(async (win) => {
await _installExtensions(win, launchOptions.extensions, options)

// cause the webview to receive focus so that
// native browser focus + blur events fire correctly
// https://github.com/cypress-io/cypress/issues/1939
Expand All @@ -363,7 +363,7 @@ module.exports = {
win.once('closed', () => {
debug('closed event fired')

Windows.removeAllExtensions()
Windows.removeAllExtensions(win)

return events.emit('exit')
})
Expand Down
2 changes: 1 addition & 1 deletion packages/server/lib/browsers/firefox-util.ts
Expand Up @@ -4,7 +4,7 @@ import _ from 'lodash'
import Marionette from 'marionette-client'
import { Command } from 'marionette-client/lib/marionette/message.js'
import util from 'util'
import Foxdriver from '@benmalka/foxdriver'
import Foxdriver from 'foxdriver'
import * as protocol from './protocol'

const errors = require('../errors')
Expand Down
9 changes: 7 additions & 2 deletions packages/server/lib/gui/events.js
Expand Up @@ -35,6 +35,11 @@ const nullifyUnserializableValues = (obj) => {
const handleEvent = function (options, bus, event, id, type, arg) {
debug('got request for event: %s, %o', type, arg)

_.defaults(options, {
windowOpenFn: Windows.open,
getWindowByWebContentsFn: Windows.getByWebContents,
})

const sendResponse = function (originalData = {}) {
try {
const data = nullifyUnserializableValues(originalData)
Expand Down Expand Up @@ -160,12 +165,12 @@ const handleEvent = function (options, bus, event, id, type, arg) {
.catch(sendErr)

case 'window:open':
return Windows.open(options.projectRoot, arg)
return options.windowOpenFn(options.projectRoot, arg)
.then(send)
.catch(sendErr)

case 'window:close':
return Windows.getByWebContents(event.sender).destroy()
return options.getWindowByWebContentsFn(event.sender).destroy()

case 'open:finder':
return open.opn(arg)
Expand Down