From c77e1877420db0810fde09059ad14d68627f03ef Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 11 Feb 2019 19:35:46 +0100 Subject: [PATCH] chore: fix "creates offscreen window with correct size" spec on Mac with Retina display (#16867) --- spec/api-browser-window-spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 4c9ef7ca67f4..844cf9701729 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -3632,8 +3632,9 @@ describe('BrowserWindow module', () => { w.webContents.once('paint', function (event, rect, data) { assert.notStrictEqual(data.length, 0) const size = data.getSize() - assertWithinDelta(size.width, 100, 2, 'width') - assertWithinDelta(size.height, 100, 2, 'height') + const scale = process.platform === 'darwin' ? devicePixelRatio : 1 + assertWithinDelta(size.width, 100 * scale, 2, 'width') + assertWithinDelta(size.height, 100 * scale, 2, 'height') done() }) w.loadFile(path.join(fixtures, 'api', 'offscreen-rendering.html'))