   transform = new WebKitCSSMatrix window.getComputedStyle(o).transform
   o.offsetLeft + transform.m41
 
+devicePixelRatio = window.devicePixelRatio || 1
+
 sleep = (duration) ->
   t = new Date
   waitsFor -> new Date - t > duration

      expect(minimapElement.offsetWidth).toBeCloseTo(editorElement.clientWidth / 11, 0)

    it 'resizes the canvas to fit the minimap', ->
      expect(canvas.offsetHeight).toEqual(minimapElement.offsetHeight + minimap.getLineHeight())
      expect(canvas.offsetWidth).toEqual(minimapElement.offsetWidth)

    it 'requests an update', ->
      expect(minimapElement.frameRequested).toBeTruthy()

          sleep(150)
          runs ->
            nextAnimationFrame()
            expect(minimapElement.canvas.width / devicePixelRatio).toEqual(4)

      describe 'when the editor is resized', ->
        beforeEach ->
