function testToolbarManagerForceHideTopToolbar() {
    var mockWindow = new MockWindow(1920, 1080);

    var toolbar = Polymer.Base.create('viewer-pdf-toolbar');
    var zoomToolbar = Polymer.Base.create('viewer-zoom-toolbar');
    var toolbarManager = new ToolbarManager(mockWindow, toolbar, zoomToolbar);
    toolbarManager.getCurrentTimestamp_ = mockGetCurrentTimestamp;

    var mouseMove = function(fromX, fromY, toX, toY, steps) {
      getMouseMoveEvents(fromX, fromY, toX, toY, steps).forEach(function(e) {
        toolbarManager.handleMouseMove(e);
      });
    };

    // Force hide the toolbar, then do a quick mousemove in the center of the
    // window. Top toolbar should not show.
    toolbarManager.forceHideTopToolbar();
    chrome.test.assertFalse(toolbar.opened);
    mouseMove(1900, 100, 100, 1000, 3);
    chrome.test.assertFalse(toolbar.opened, 'Closed before move 1');
    // Move back into the zoom toolbar again. The top toolbar should still not
    // show.
    mouseMove(100, 500, 1900, 1000, 3);
    chrome.test.assertFalse(toolbar.opened, 'Closed after move 1');

    // Hide the toolbar, wait for the timeout to expire, then move the mouse
    // quickly. The top toolbar should show.
    toolbarManager.forceHideTopToolbar();
    chrome.test.assertFalse(toolbar.opened, 'Closed before move 2');
    // Manually expire the timeout. This is the same as waiting 1 second.
    mockWindow.runTimeout();
    mouseMove(1900, 1000, 100, 1000, 3);
    chrome.test.assertTrue(toolbar.opened, 'Opened after move 2');

    // Force hide the toolbar, then move the mouse to the top of the screen. The
    // top toolbar should show.
    toolbarManager.forceHideTopToolbar();
    chrome.test.assertFalse(toolbar.opened, 'Closed before move 3');
    mouseMove(1900, 1000, 1000, 30, 3);
    chrome.test.assertTrue(toolbar.opened, 'Opened after move 3');

    chrome.test.succeed();
  }
/**
   * Test that ToolbarManager.forceHideTopToolbar hides (or shows) the top
   * toolbar correctly for different mouse movements.
   */
Test that ToolbarManager.forceHideTopToolbar hides (or shows) the top
toolbar correctly for different mouse movements.
Test that ToolbarManager . forceHideTopToolbar hides ( or shows ) the top toolbar correctly for different mouse movements .
function testToolbarManagerForceHideTopToolbar() {
    var mockWindow = new MockWindow(1920, 1080);
    var toolbar = Polymer.Base.create('viewer-pdf-toolbar');
    var zoomToolbar = Polymer.Base.create('viewer-zoom-toolbar');
    var toolbarManager = new ToolbarManager(mockWindow, toolbar, zoomToolbar);
    toolbarManager.getCurrentTimestamp_ = mockGetCurrentTimestamp;
    var mouseMove = function(fromX, fromY, toX, toY, steps) {
      getMouseMoveEvents(fromX, fromY, toX, toY, steps).forEach(function(e) {
        toolbarManager.handleMouseMove(e);
      });
    };
    toolbarManager.forceHideTopToolbar();
    chrome.test.assertFalse(toolbar.opened);
    mouseMove(1900, 100, 100, 1000, 3);
    chrome.test.assertFalse(toolbar.opened, 'Closed before move 1');
    mouseMove(100, 500, 1900, 1000, 3);
    chrome.test.assertFalse(toolbar.opened, 'Closed after move 1');
    toolbarManager.forceHideTopToolbar();
    chrome.test.assertFalse(toolbar.opened, 'Closed before move 2');
    mockWindow.runTimeout();
    mouseMove(1900, 1000, 100, 1000, 3);
    chrome.test.assertTrue(toolbar.opened, 'Opened after move 2');
    toolbarManager.forceHideTopToolbar();
    chrome.test.assertFalse(toolbar.opened, 'Closed before move 3');
    mouseMove(1900, 1000, 1000, 30, 3);
    chrome.test.assertTrue(toolbar.opened, 'Opened after move 3');
    chrome.test.succeed();
  }
function testToolbarManagerForceHideTopToolbar ( ) { var mockWindow = new MockWindow ( 1920 , 1080 ) ; var toolbar = Polymer . Base . create ( 'viewer-pdf-toolbar' ) ; var zoomToolbar = Polymer . Base . create ( 'viewer-zoom-toolbar' ) ; var toolbarManager = new ToolbarManager ( mockWindow , toolbar , zoomToolbar ) ; toolbarManager . getCurrentTimestamp_ = mockGetCurrentTimestamp ; var mouseMove = function ( fromX , fromY , toX , toY , steps ) { getMouseMoveEvents ( fromX , fromY , toX , toY , steps ) . forEach ( function ( e ) { toolbarManager . handleMouseMove ( e ) ; } ) ; } ; toolbarManager . forceHideTopToolbar ( ) ; chrome . test . assertFalse ( toolbar . opened ) ; mouseMove ( 1900 , 100 , 100 , 1000 , 3 ) ; chrome . test . assertFalse ( toolbar . opened , 'Closed before move 1' ) ; mouseMove ( 100 , 500 , 1900 , 1000 , 3 ) ; chrome . test . assertFalse ( toolbar . opened , 'Closed after move 1' ) ; toolbarManager . forceHideTopToolbar ( ) ; chrome . test . assertFalse ( toolbar . opened , 'Closed before move 2' ) ; mockWindow . runTimeout ( ) ; mouseMove ( 1900 , 1000 , 100 , 1000 , 3 ) ; chrome . test . assertTrue ( toolbar . opened , 'Opened after move 2' ) ; toolbarManager . forceHideTopToolbar ( ) ; chrome . test . assertFalse ( toolbar . opened , 'Closed before move 3' ) ; mouseMove ( 1900 , 1000 , 1000 , 30 , 3 ) ; chrome . test . assertTrue ( toolbar . opened , 'Opened after move 3' ) ; chrome . test . succeed ( ) ; }
Test that ToolbarManager.forceHideTopToolbar hides (or shows) the top
 toolbar correctly for different mouse movements.
Test that ToolbarManager . forceHideTopToolbar hides ( or shows ) the top toolbar correctly for different mouse movements .
// Force hide the toolbar, then do a quick mousemove in the center of the // window. Top toolbar should not show. // Move back into the zoom toolbar again. The top toolbar should still not // show. // Hide the toolbar, wait for the timeout to expire, then move the mouse // quickly. The top toolbar should show. // Manually expire the timeout. This is the same as waiting 1 second. // Force hide the toolbar, then move the mouse to the top of the screen. The // top toolbar should show.