function testToolbarKeyboardNavigation() {
    var mockWindow = new MockWindow(1920, 1080);
    var toolbar =
        Polymer.Base.create('viewer-pdf-toolbar', {loadProgress: 100});
    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);
      });
    };

    // Move the mouse and then hit tab -> Toolbars stay open.
    mouseMove(200, 200, 800, 800, 5);
    toolbarManager.showToolbarsForKeyboardNavigation();
    chrome.test.assertTrue(toolbar.opened);
    mockWindow.runTimeout();
    chrome.test.assertTrue(
        toolbar.opened, 'toolbar stays open after keyboard navigation');

    // Hit escape -> Toolbars close.
    toolbarManager.hideSingleToolbarLayer();
    chrome.test.assertFalse(toolbar.opened, 'toolbars close on escape key');

    // Show toolbars, use mouse, run timeout -> Toolbars close.
    toolbarManager.showToolbarsForKeyboardNavigation();
    mouseMove(200, 200, 800, 800, 5);
    chrome.test.assertTrue(toolbar.opened);
    mockWindow.runTimeout();
    chrome.test.assertFalse(toolbar.opened, 'toolbars close after mouse move');

    chrome.test.succeed();
  }
/**
   * Test that the toolbar will not be hidden when navigating with the tab key.
   */
Test that the toolbar will not be hidden when navigating with the tab key.
Test that the toolbar will not be hidden when navigating with the tab key .
function testToolbarKeyboardNavigation() {
    var mockWindow = new MockWindow(1920, 1080);
    var toolbar =
        Polymer.Base.create('viewer-pdf-toolbar', {loadProgress: 100});
    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);
      });
    };
    mouseMove(200, 200, 800, 800, 5);
    toolbarManager.showToolbarsForKeyboardNavigation();
    chrome.test.assertTrue(toolbar.opened);
    mockWindow.runTimeout();
    chrome.test.assertTrue(
        toolbar.opened, 'toolbar stays open after keyboard navigation');
    toolbarManager.hideSingleToolbarLayer();
    chrome.test.assertFalse(toolbar.opened, 'toolbars close on escape key');
    toolbarManager.showToolbarsForKeyboardNavigation();
    mouseMove(200, 200, 800, 800, 5);
    chrome.test.assertTrue(toolbar.opened);
    mockWindow.runTimeout();
    chrome.test.assertFalse(toolbar.opened, 'toolbars close after mouse move');
    chrome.test.succeed();
  }
function testToolbarKeyboardNavigation ( ) { var mockWindow = new MockWindow ( 1920 , 1080 ) ; var toolbar = Polymer . Base . create ( 'viewer-pdf-toolbar' , { loadProgress : 100 } ) ; 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 ) ; } ) ; } ; mouseMove ( 200 , 200 , 800 , 800 , 5 ) ; toolbarManager . showToolbarsForKeyboardNavigation ( ) ; chrome . test . assertTrue ( toolbar . opened ) ; mockWindow . runTimeout ( ) ; chrome . test . assertTrue ( toolbar . opened , 'toolbar stays open after keyboard navigation' ) ; toolbarManager . hideSingleToolbarLayer ( ) ; chrome . test . assertFalse ( toolbar . opened , 'toolbars close on escape key' ) ; toolbarManager . showToolbarsForKeyboardNavigation ( ) ; mouseMove ( 200 , 200 , 800 , 800 , 5 ) ; chrome . test . assertTrue ( toolbar . opened ) ; mockWindow . runTimeout ( ) ; chrome . test . assertFalse ( toolbar . opened , 'toolbars close after mouse move' ) ; chrome . test . succeed ( ) ; }
Test that the toolbar will not be hidden when navigating with the tab key.
Test that the toolbar will not be hidden when navigating with the tab key .
// Move the mouse and then hit tab -> Toolbars stay open. // Hit escape -> Toolbars close. // Show toolbars, use mouse, run timeout -> Toolbars close.