Skip to content

Commit f3c1bfb

Browse files
authored
Merge pull request #884 from electron-userland/v14.0.0
v14.0.0
2 parents f4d097a + d2ecadc commit f3c1bfb

File tree

14 files changed

+233
-64
lines changed

14 files changed

+233
-64
lines changed

package-lock.json

Lines changed: 180 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spectron",
3-
"version": "13.0.0",
3+
"version": "14.0.0",
44
"description": "Easily test your Electron apps using ChromeDriver and WebdriverIO.",
55
"main": "index.js",
66
"types": "./lib/spectron.d.ts",
@@ -26,8 +26,9 @@
2626
"author": "Kevin Sawicki",
2727
"license": "MIT",
2828
"dependencies": {
29+
"@electron/remote": "^1.0.4",
2930
"dev-null": "^0.1.1",
30-
"electron-chromedriver": "^11.0.0",
31+
"electron-chromedriver": "^12.0.0",
3132
"got": "^11.8.0",
3233
"split": "^1.0.1",
3334
"webdriverio": "^6.9.1"
@@ -39,7 +40,7 @@
3940
"chai-as-promised": "^7.1.1",
4041
"chai-roughly": "^1.0.0",
4142
"check-for-leaks": "^1.2.1",
42-
"electron": "^11.0.3",
43+
"electron": "^12.0.0",
4344
"eslint": "^7.14.0",
4445
"eslint-config-standard": "^16.0.2",
4546
"eslint-plugin-import": "^2.22.1",

test/application-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('application loading', function () {
149149
it('gets the render process console logs and clears them', async function () {
150150
await app.client.waitUntilWindowLoaded();
151151
let logs = await app.client.getRenderProcessLogs();
152-
expect(logs.length).to.equal(2);
152+
expect(logs.length).to.equal(3);
153153
expect(logs[0].message).to.contain('7:14 "render warn"');
154154
expect(logs[0].source).to.equal('console-api');
155155
expect(logs[0].level).to.equal('WARNING');

test/fixtures/accessible/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { app, BrowserWindow } = require('electron');
2+
require('@electron/remote/main').initialize();
23

34
let mainWindow = null;
45

@@ -9,7 +10,8 @@ app.on('ready', function () {
910
height: 600,
1011
webPreferences: {
1112
nodeIntegration: true,
12-
enableRemoteModule: true
13+
enableRemoteModule: true,
14+
contextIsolation: false
1315
}
1416
});
1517
mainWindow.loadFile('index.html');

test/fixtures/app/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { app, BrowserWindow, ipcMain } = require('electron');
2+
require('@electron/remote/main').initialize();
23
const fs = require('fs');
34
const path = require('path');
45

@@ -20,7 +21,8 @@ app.on('ready', function () {
2021
height: 100,
2122
webPreferences: {
2223
enableRemoteModule: true,
23-
nodeIntegration: true
24+
nodeIntegration: true,
25+
contextIsolation: false
2426
}
2527
});
2628
mainWindow.loadFile('index.html');

test/fixtures/example/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { app, BrowserWindow } = require('electron');
2+
require('@electron/remote/main').initialize();
23

34
let mainWindow = null;
45

@@ -11,7 +12,8 @@ app.on('ready', function () {
1112
minWidth: 100,
1213
webPreferences: {
1314
nodeIntegration: true,
14-
enableRemoteModule: true
15+
enableRemoteModule: true,
16+
contextIsolation: false
1517
}
1618
});
1719
mainWindow.loadFile('index.html');

test/fixtures/multi-window/main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { app, BrowserWindow } = require('electron');
2+
require('@electron/remote/main').initialize();
23

34
let topWindow = null;
45
let bottomWindow = null;
@@ -11,7 +12,8 @@ app.on('ready', function () {
1112
height: 100,
1213
webPreferences: {
1314
nodeIntegration: true,
14-
enableRemoteModule: true
15+
enableRemoteModule: true,
16+
contextIsolation: false
1517
}
1618
});
1719
topWindow.loadFile('index-top.html');
@@ -26,7 +28,8 @@ app.on('ready', function () {
2628
height: 50,
2729
webPreferences: {
2830
nodeIntegration: true,
29-
enableRemoteModule: true
31+
enableRemoteModule: true,
32+
contextIsolation: false
3033
}
3134
});
3235
bottomWindow.loadFile('index-bottom.html');

test/fixtures/no-node-integration/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { app, BrowserWindow } = require('electron');
2+
require('@electron/remote/main').initialize();
23

34
let mainWindow = null;
45

@@ -10,7 +11,8 @@ app.on('ready', function () {
1011
height: 100,
1112
webPreferences: {
1213
nodeIntegration: false,
13-
enableRemoteModule: true
14+
enableRemoteModule: true,
15+
contextIsolation: false
1416
}
1517
});
1618
mainWindow.loadFile('index.html');

test/fixtures/not-accessible/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
<body>
1414
<div>unreadable</div>
1515
<input>
16-
<webview src="web-view.html" nodeintegration>
16+
<webview
17+
src="web-view.html"
18+
enableremotemodule="true"
19+
nodeintegration
20+
webpreferences="contextIsolation=false"
21+
>
22+
</webview>
1723
</body>
1824
</html>

test/fixtures/not-accessible/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { app, BrowserWindow } = require('electron');
2+
require('@electron/remote/main').initialize();
23

34
let mainWindow = null;
45

@@ -9,8 +10,9 @@ app.on('ready', function () {
910
height: 600,
1011
webPreferences: {
1112
nodeIntegration: true,
12-
webviewTag: true,
13-
enableRemoteModule: true
13+
contextIsolation: false,
14+
enableRemoteModule: true,
15+
webviewTag: true
1416
}
1517
});
1618
mainWindow.loadFile('index.html');

0 commit comments

Comments
 (0)