function testInputMethod() {
  var webview = document.createElement('webview');
  g_webview = webview;
  document.body.appendChild(webview);

  var onChannelEstablished = function(webview) {};

  if (!g_inputMethodTestHelper) {
    g_inputMethodTestHelper = new InputMethodTestHelper();
  }

  embedder.waitForResponseFromGuest_(
      webview,
      'inject_input_method.js',
      onChannelEstablished,
      'response-inputMethodPreparedForFocus',
      function(data) {
        g_inputMethodTestHelper.registerMessageHandler();
        webview.focus();
        webview.contentWindow.postMessage(
            JSON.stringify(['request-waitForFocus']), '*');
      });
}
// selection through caret works properly.
selection through caret works properly.
selection through caret works properly .
function testInputMethod() {
  var webview = document.createElement('webview');
  g_webview = webview;
  document.body.appendChild(webview);
  var onChannelEstablished = function(webview) {};
  if (!g_inputMethodTestHelper) {
    g_inputMethodTestHelper = new InputMethodTestHelper();
  }
  embedder.waitForResponseFromGuest_(
      webview,
      'inject_input_method.js',
      onChannelEstablished,
      'response-inputMethodPreparedForFocus',
      function(data) {
        g_inputMethodTestHelper.registerMessageHandler();
        webview.focus();
        webview.contentWindow.postMessage(
            JSON.stringify(['request-waitForFocus']), '*');
      });
}
function testInputMethod ( ) { var webview = document . createElement ( 'webview' ) ; g_webview = webview ; document . body . appendChild ( webview ) ; var onChannelEstablished = function ( webview ) { } ; if ( ! g_inputMethodTestHelper ) { g_inputMethodTestHelper = new InputMethodTestHelper ( ) ; } embedder . waitForResponseFromGuest_ ( webview , 'inject_input_method.js' , onChannelEstablished , 'response-inputMethodPreparedForFocus' , function ( data ) { g_inputMethodTestHelper . registerMessageHandler ( ) ; webview . focus ( ) ; webview . contentWindow . postMessage ( JSON . stringify ( [ 'request-waitForFocus' ] ) , '*' ) ; } ) ; }
selection through caret works properly.
selection through caret works properly .