From 683bef5b9d133cb194b476938c77cc07fd05b972 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 16 May 2016 18:10:38 +0200 Subject: [PATCH 1/6] Set BrowserWindow's background color to white to re-enable sub-pixel AA In Electron 0.37.3 the default background color has changed from white to transparent, and as per the sub pixel anti-aliasing specification, the layer which hosts the glyphs that need to be rendered needs to have an opaque background. We have also observed that upon reload everything seems to work smoothly even without this fix: this probably points in the direction of a regression in Electron, but in the meantime this fix should suffice to allow us to proceed. --- src/browser/atom-window.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index 2f07dd443..0ee44d240 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -24,6 +24,7 @@ class AtomWindow options = show: false title: 'Atom' + backgroundColor: "#fff" webPreferences: backgroundThrottling: not @isSpec From 764de235a87258e9c84d4d2626c9f4e699fa353a Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 17 May 2016 09:44:54 +0200 Subject: [PATCH 2/6] :memo: Remember why we added backgroundColor --- src/browser/atom-window.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index 0ee44d240..d70bda297 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -24,6 +24,10 @@ class AtomWindow options = show: false title: 'Atom' + # Add an opaque backgroundColor (instead of keeping the default + # transparent one) to prevent subpixel anti-aliasing from being disabled. + # We believe this is a regression introduced with Electron 0.37.3, and + # thus we should remove this as soon as a fix gets released. backgroundColor: "#fff" webPreferences: backgroundThrottling: not @isSpec From 1cf4e4a8a2b6c531c644fe33ddb91de06019f359 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 17 May 2016 09:47:04 +0200 Subject: [PATCH 3/6] :memo: Remember why we added backgroundThrottling --- src/browser/atom-window.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index d70bda297..c2909f8c9 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -30,6 +30,10 @@ class AtomWindow # thus we should remove this as soon as a fix gets released. backgroundColor: "#fff" webPreferences: + # Prevent specs from throttling when the window is in the background: + # this should result in faster CI builds, and an improvement in the + # local development experience when running specs through the UI (which + # now won't pause when e.g. minimizing the window). backgroundThrottling: not @isSpec # Don't set icon on Windows so the exe's ico will be used as window and From 124b5d5efe6b096be67894be9898a3f32a62b738 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 17 May 2016 11:18:13 +0200 Subject: [PATCH 4/6] :fire: Remove duplicate ipcMain.on --- src/browser/atom-application.coffee | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index d08990264..a9fa92c4b 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -325,9 +325,6 @@ class AtomApplication ipcMain.on 'get-auto-update-manager-error', (event) => event.returnValue = @autoUpdateManager.getErrorMessage() - ipcMain.on 'execute-javascript-in-dev-tools', (event, code) -> - event.sender.devToolsWebContents?.executeJavaScript(code) - setupDockMenu: -> if process.platform is 'darwin' dockMenu = Menu.buildFromTemplate [ From a624489d0f3805a29146d9a8ec60fba330437695 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 17 May 2016 13:01:33 +0200 Subject: [PATCH 5/6] Fix opening console in DevTools --- src/atom-environment.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index 1d60872df..1d1a7b2af 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -730,7 +730,7 @@ class AtomEnvironment extends Model @emitter.emit 'will-throw-error', eventObject if openDevTools - @openDevTools().then => @executeJavaScriptInDevTools('DevToolsAPI.showConsole()') + @openDevTools().then => @executeJavaScriptInDevTools('DevToolsAPI.showPanel("console")') @emitter.emit 'did-throw-error', {message, url, line, column, originalError} From ad166db6c4b7feb1302fd529bf85088d458a7251 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 17 May 2016 13:56:57 +0200 Subject: [PATCH 6/6] Don't use temp for integration tests socket creation --- spec/integration/helpers/start-atom.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/integration/helpers/start-atom.coffee b/spec/integration/helpers/start-atom.coffee index 2939dd6ab..7a9311896 100644 --- a/spec/integration/helpers/start-atom.coffee +++ b/spec/integration/helpers/start-atom.coffee @@ -1,6 +1,7 @@ path = require 'path' http = require 'http' temp = require('temp').track() +os = require('os') remote = require 'remote' async = require 'async' {map, extend, once, difference} = require 'underscore-plus' @@ -10,7 +11,7 @@ webdriverio = require '../../../build/node_modules/webdriverio' AtomPath = remote.process.argv[0] AtomLauncherPath = path.join(__dirname, "..", "helpers", "atom-launcher.sh") ChromedriverPath = path.resolve(__dirname, '..', '..', '..', 'electron', 'chromedriver', 'chromedriver') -SocketPath = path.join(temp.mkdirSync("socket-dir"), "atom-#{process.env.USER}.sock") +SocketPath = path.join(os.tmpdir(), "atom-integration-test-#{Date.now()}.sock") ChromedriverPort = 9515 ChromedriverURLBase = "/wd/hub" ChromedriverStatusURL = "http://localhost:#{ChromedriverPort}#{ChromedriverURLBase}/status"