function testHandwritingLayoutAsync(testDoneCallback) {
  var compactKeysets = [
    'us.compact.qwerty', 'us.compact.symbol', 'us.compact.more',
    'us.compact.numberpad'
  ];
  var testCallback = function() {
    // Non-active keysets are lazy loaded in order to reduce latency before
    // the virtual keyboard is shown. Wait until the load is complete to
    // continue testing.
    onKeysetsReady(compactKeysets, function() {
      var menu = document.querySelector('.inputview-menu-view');
      assertEquals(
          'none', getComputedStyle(menu).display,
          'Menu should be hidden initially');
      mockTap(findKeyById('Menu'));
      assertFalse(
          menu.hidden,
          'Menu should be visible after tapping menu toggle button');
      var menuBounds = menu.getBoundingClientRect();
      assertTrue(
          menuBounds.width > 0 && menuBounds.height > 0,
          'Expect non-zero menu bounds.');
      var hwtSelect = menu.querySelector('#handwriting');
      assertTrue(!!hwtSelect, 'Handwriting should be available for testing');
      var hwtSelectBounds = hwtSelect.getBoundingClientRect();
      assertTrue(
          hwtSelectBounds.width > 0 && hwtSelectBounds.height > 0,
          'Expect non-zero size for hwt select button.');
      onSwitchToKeyset('hwt', function() {
        // The tests below for handwriting part is for material design.
        var view = getActiveView();
        assertEquals('hwt', view.id, 'Handwriting layout is not active.');
        var hwtCanvasView = view.querySelector('#canvasView');
        assertTrue(!!hwtCanvasView, 'Unable to find canvas view');
        var panelView = document.getElementById('panelView');
        assertTrue(!!panelView, 'Unable to find panel view');
        var backButton = panelView.querySelector('#backToKeyboard');
        assertTrue(!!backButton, 'Unable to find back button.');
        onSwitchToKeyset('us.compact.qwerty', function() {
          assertEquals(
              'us-compact-qwerty', getActiveView().id,
              'compact layout is not active.');
          testDoneCallback();
        });
        mockTap(backButton);
      });
      mockTap(hwtSelect);
    });
  };
  var config = {
    keyset: 'us.compact.qwerty',
    languageCode: 'en',
    passwordLayout: 'us',
    name: 'English',
    options: {enableHwtForTesting: true}
  };
  onKeyboardReady(testCallback, config);
}
/**
 * Validates Handwriting layout. Though handwriting is disabled for the system
 * VK, the layout is still available and useful for testing expected behavior of
 * the IME-VKs since the codebase is shared.
 */
Validates Handwriting layout. Though handwriting is disabled for the system
VK, the layout is still available and useful for testing expected behavior of
the IME-VKs since the codebase is shared.
Validates Handwriting layout . Though handwriting is disabled for the system VK the layout is still available and useful for testing expected behavior of the IME - VKs since the codebase is shared .
function testHandwritingLayoutAsync(testDoneCallback) {
  var compactKeysets = [
    'us.compact.qwerty', 'us.compact.symbol', 'us.compact.more',
    'us.compact.numberpad'
  ];
  var testCallback = function() {
    onKeysetsReady(compactKeysets, function() {
      var menu = document.querySelector('.inputview-menu-view');
      assertEquals(
          'none', getComputedStyle(menu).display,
          'Menu should be hidden initially');
      mockTap(findKeyById('Menu'));
      assertFalse(
          menu.hidden,
          'Menu should be visible after tapping menu toggle button');
      var menuBounds = menu.getBoundingClientRect();
      assertTrue(
          menuBounds.width > 0 && menuBounds.height > 0,
          'Expect non-zero menu bounds.');
      var hwtSelect = menu.querySelector('#handwriting');
      assertTrue(!!hwtSelect, 'Handwriting should be available for testing');
      var hwtSelectBounds = hwtSelect.getBoundingClientRect();
      assertTrue(
          hwtSelectBounds.width > 0 && hwtSelectBounds.height > 0,
          'Expect non-zero size for hwt select button.');
      onSwitchToKeyset('hwt', function() {
        var view = getActiveView();
        assertEquals('hwt', view.id, 'Handwriting layout is not active.');
        var hwtCanvasView = view.querySelector('#canvasView');
        assertTrue(!!hwtCanvasView, 'Unable to find canvas view');
        var panelView = document.getElementById('panelView');
        assertTrue(!!panelView, 'Unable to find panel view');
        var backButton = panelView.querySelector('#backToKeyboard');
        assertTrue(!!backButton, 'Unable to find back button.');
        onSwitchToKeyset('us.compact.qwerty', function() {
          assertEquals(
              'us-compact-qwerty', getActiveView().id,
              'compact layout is not active.');
          testDoneCallback();
        });
        mockTap(backButton);
      });
      mockTap(hwtSelect);
    });
  };
  var config = {
    keyset: 'us.compact.qwerty',
    languageCode: 'en',
    passwordLayout: 'us',
    name: 'English',
    options: {enableHwtForTesting: true}
  };
  onKeyboardReady(testCallback, config);
}
function testHandwritingLayoutAsync ( testDoneCallback ) { var compactKeysets = [ 'us.compact.qwerty' , 'us.compact.symbol' , 'us.compact.more' , 'us.compact.numberpad' ] ; var testCallback = function ( ) { onKeysetsReady ( compactKeysets , function ( ) { var menu = document . querySelector ( '.inputview-menu-view' ) ; assertEquals ( 'none' , getComputedStyle ( menu ) . display , 'Menu should be hidden initially' ) ; mockTap ( findKeyById ( 'Menu' ) ) ; assertFalse ( menu . hidden , 'Menu should be visible after tapping menu toggle button' ) ; var menuBounds = menu . getBoundingClientRect ( ) ; assertTrue ( menuBounds . width > 0 && menuBounds . height > 0 , 'Expect non-zero menu bounds.' ) ; var hwtSelect = menu . querySelector ( '#handwriting' ) ; assertTrue ( ! ! hwtSelect , 'Handwriting should be available for testing' ) ; var hwtSelectBounds = hwtSelect . getBoundingClientRect ( ) ; assertTrue ( hwtSelectBounds . width > 0 && hwtSelectBounds . height > 0 , 'Expect non-zero size for hwt select button.' ) ; onSwitchToKeyset ( 'hwt' , function ( ) { var view = getActiveView ( ) ; assertEquals ( 'hwt' , view . id , 'Handwriting layout is not active.' ) ; var hwtCanvasView = view . querySelector ( '#canvasView' ) ; assertTrue ( ! ! hwtCanvasView , 'Unable to find canvas view' ) ; var panelView = document . getElementById ( 'panelView' ) ; assertTrue ( ! ! panelView , 'Unable to find panel view' ) ; var backButton = panelView . querySelector ( '#backToKeyboard' ) ; assertTrue ( ! ! backButton , 'Unable to find back button.' ) ; onSwitchToKeyset ( 'us.compact.qwerty' , function ( ) { assertEquals ( 'us-compact-qwerty' , getActiveView ( ) . id , 'compact layout is not active.' ) ; testDoneCallback ( ) ; } ) ; mockTap ( backButton ) ; } ) ; mockTap ( hwtSelect ) ; } ) ; } ; var config = { keyset : 'us.compact.qwerty' , languageCode : 'en' , passwordLayout : 'us' , name : 'English' , options : { enableHwtForTesting : true } } ; onKeyboardReady ( testCallback , config ) ; }
Validates Handwriting layout.
Validates Handwriting layout .
// Non-active keysets are lazy loaded in order to reduce latency before // the virtual keyboard is shown. Wait until the load is complete to // continue testing. // The tests below for handwriting part is for material design.