Merge "/*.php: Replace implicit Bugzilla bug numbers with Phab ones"
[lhc/web/wiklou.git] / tests / qunit / suites / resources / jquery / jquery.hidpi.test.js
index 140da38..6a265eb 100644 (file)
@@ -6,6 +6,22 @@
                assert.equal( typeof devicePixelRatio, 'number', '$.devicePixelRatio() returns a number' );
        } );
 
+       QUnit.test( 'bracketedDevicePixelRatio', function ( assert ) {
+               var ratio = $.bracketedDevicePixelRatio();
+               assert.equal( typeof ratio, 'number', '$.bracketedDevicePixelRatio() returns a number' );
+       } );
+
+       QUnit.test( 'bracketDevicePixelRatio', 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', function ( assert ) {
                var srcset = 'onefive.png 1.5x, two.png 2x';