summaryrefslogtreecommitdiff
path: root/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /tests/qunit/suites/resources/jquery/jquery.hidpi.test.js
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'tests/qunit/suites/resources/jquery/jquery.hidpi.test.js')
-rw-r--r--tests/qunit/suites/resources/jquery/jquery.hidpi.test.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js b/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js
index 906369ee..8c628765 100644
--- a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js
+++ b/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js
@@ -6,6 +6,22 @@
assert.equal( typeof devicePixelRatio, 'number', '$.devicePixelRatio() returns a number' );
} );
+ QUnit.test( 'bracketedDevicePixelRatio', 1, function ( assert ) {
+ var devicePixelRatio = $.devicePixelRatio();
+ assert.equal( typeof devicePixelRatio, 'number', '$.bracketedDevicePixelRatio() returns a number' );
+ } );
+
+ QUnit.test( 'bracketDevicePixelRatio', 8, function ( assert ) {
+ assert.equal( $.bracketDevicePixelRatio( 0.75 ), 1, '0.75 gives 1' );
+ assert.equal( $.bracketDevicePixelRatio( 1 ), 1, '1 gives 1' );
+ assert.equal( $.bracketDevicePixelRatio( 1.25 ), 1.5, '1.25 gives 1.5' );
+ assert.equal( $.bracketDevicePixelRatio( 1.5 ), 1.5, '1.5 gives 1.5' );
+ assert.equal( $.bracketDevicePixelRatio( 1.75 ), 2, '1.75 gives 2' );
+ assert.equal( $.bracketDevicePixelRatio( 2 ), 2, '2 gives 2' );
+ assert.equal( $.bracketDevicePixelRatio( 2.5 ), 2, '2.5 gives 2' );
+ assert.equal( $.bracketDevicePixelRatio( 3 ), 2, '3 gives 2' );
+ } );
+
QUnit.test( 'matchSrcSet', 6, function ( assert ) {
var srcset = 'onefive.png 1.5x, two.png 2x';