function testToolbarTouchInteraction() {
    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.hideToolbarsIfAllowed();
    chrome.test.assertFalse(toolbar.opened);

    // Tap anywhere on the screen -> Toolbars open.
    toolbarManager.handleMouseMove(makeTapEvent(500, 500));
    chrome.test.assertTrue(toolbar.opened, "toolbars open after tap");

    // Tap again -> Toolbars close.
    toolbarManager.handleMouseMove(makeTapEvent(500, 500));
    chrome.test.assertFalse(toolbar.opened, "toolbars close after tap");

    // Open toolbars, wait 2 seconds -> Toolbars close.
    toolbarManager.handleMouseMove(makeTapEvent(500, 500));
    mockWindow.runTimeout();
    chrome.test.assertFalse(toolbar.opened, "toolbars close after wait");

    // Open toolbars, tap near toolbars -> Toolbar doesn't close.
    toolbarManager.handleMouseMove(makeTapEvent(500, 500));
    toolbarManager.handleMouseMove(makeTapEvent(100, 75));
    chrome.test.assertTrue(toolbar.opened,
                           "toolbars stay open after tap near toolbars");
    mockWindow.runTimeout();
    chrome.test.assertTrue(toolbar.opened,
                           "tap near toolbars prevents auto close");

    chrome.test.succeed();
  }
/**
   * Test that the toolbars can be shown or hidden by tapping with a touch
   * device.
   */
Test that the toolbars can be shown or hidden by tapping with a touch
device.
Test that the toolbars can be shown or hidden by tapping with a touch device .
function testToolbarTouchInteraction() {
    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.hideToolbarsIfAllowed();
    chrome.test.assertFalse(toolbar.opened);
    toolbarManager.handleMouseMove(makeTapEvent(500, 500));
    chrome.test.assertTrue(toolbar.opened, "toolbars open after tap");
    toolbarManager.handleMouseMove(makeTapEvent(500, 500));
    chrome.test.assertFalse(toolbar.opened, "toolbars close after tap");
    toolbarManager.handleMouseMove(makeTapEvent(500, 500));
    mockWindow.runTimeout();
    chrome.test.assertFalse(toolbar.opened, "toolbars close after wait");
    toolbarManager.handleMouseMove(makeTapEvent(500, 500));
    toolbarManager.handleMouseMove(makeTapEvent(100, 75));
    chrome.test.assertTrue(toolbar.opened,
                           "toolbars stay open after tap near toolbars");
    mockWindow.runTimeout();
    chrome.test.assertTrue(toolbar.opened,
                           "tap near toolbars prevents auto close");
    chrome.test.succeed();
  }
function testToolbarTouchInteraction ( ) { 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 . hideToolbarsIfAllowed ( ) ; chrome . test . assertFalse ( toolbar . opened ) ; toolbarManager . handleMouseMove ( makeTapEvent ( 500 , 500 ) ) ; chrome . test . assertTrue ( toolbar . opened , "toolbars open after tap" ) ; toolbarManager . handleMouseMove ( makeTapEvent ( 500 , 500 ) ) ; chrome . test . assertFalse ( toolbar . opened , "toolbars close after tap" ) ; toolbarManager . handleMouseMove ( makeTapEvent ( 500 , 500 ) ) ; mockWindow . runTimeout ( ) ; chrome . test . assertFalse ( toolbar . opened , "toolbars close after wait" ) ; toolbarManager . handleMouseMove ( makeTapEvent ( 500 , 500 ) ) ; toolbarManager . handleMouseMove ( makeTapEvent ( 100 , 75 ) ) ; chrome . test . assertTrue ( toolbar . opened , "toolbars stay open after tap near toolbars" ) ; mockWindow . runTimeout ( ) ; chrome . test . assertTrue ( toolbar . opened , "tap near toolbars prevents auto close" ) ; chrome . test . succeed ( ) ; }
Test that the toolbars can be shown or hidden by tapping with a touch
 device.
Test that the toolbars can be shown or hidden by tapping with a touch device .
// Tap anywhere on the screen -> Toolbars open. // Tap again -> Toolbars close. // Open toolbars, wait 2 seconds -> Toolbars close. // Open toolbars, tap near toolbars -> Toolbar doesn't close.