Skip to content

Commit f4707f2

Browse files
committed
Use a smarter fix for tests.
1 parent efa3582 commit f4707f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/bitmap.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ test('Get a bitmap of a specific size.', function(t)
3535
var img = robot.screen.capture(0, 0, size, size);
3636

3737
// Support for higher density screens.
38-
if (img.width == (size*2)) size = img.width;
38+
var multi = img.width / size;
39+
var size = size * multi;
3940
t.equals(img.height, size, 'make sure image is expected height.');
4041
t.equals(img.width, size, 'make sure image is expected width.');
4142
});
@@ -53,7 +54,9 @@ test('Get a bitmap and make sure the colorAt works as expected.', function(t)
5354
var height = screenSize.height;
5455

5556
// Support for higher density screens.
56-
if (img.width === (width*2)) width = img.width; height = img.height;
57+
var multi = img.width / width;
58+
width = width * multi;
59+
height = height * multi;
5760

5861
t.throws(function()
5962
{

0 commit comments

Comments
 (0)