Skip to content

Commit

Permalink
chore: fix "creates offscreen window with correct size" spec on Mac w…
Browse files Browse the repository at this point in the history
…ith Retina display (#16877)
  • Loading branch information
trop[bot] authored and codebytere committed Feb 11, 2019
1 parent d2538cd commit f7508f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/api-browser-window-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3518,8 +3518,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'))
Expand Down

0 comments on commit f7508f1

Please sign in to comment.