function testFindAPI_findupdate() {
  var webview = new WebView();
  webview.src = testFindPage;

  var canceledTest = false;
  webview.addEventListener('loadstop', function(e) {
    // Test the |findupdate| event.
    webview.addEventListener('findupdate', function(e) {
      if (e.activeMatchOrdinal > 0) {
        embedder.test.assertTrue(e.numberOfMatches >= e.activeMatchOrdinal)
        embedder.test.assertTrue(e.selectionRect.width > 0);
        embedder.test.assertTrue(e.selectionRect.height > 0);
      }

      if (e.finalUpdate) {
        if (e.canceled) {
          canceledTest = true;
        } else {
          embedder.test.assertEq(e.searchText, "cat");
          embedder.test.assertEq(e.numberOfMatches, 10);
          embedder.test.assertEq(e.activeMatchOrdinal, 1);
          embedder.test.assertTrue(canceledTest);
          embedder.test.succeed();
        }
      }
    });
    webview.find("dog");
    webview.find("dog");
    webview.find("cat");
  });

  document.body.appendChild(webview);
}
// likely because the search for "dog" compelted too quickly. crbug.com/710486.
likely because the search for "dog" compelted too quickly.
likely because the search for " dog " compelted too quickly .
function testFindAPI_findupdate() {
  var webview = new WebView();
  webview.src = testFindPage;
  var canceledTest = false;
  webview.addEventListener('loadstop', function(e) {
    webview.addEventListener('findupdate', function(e) {
      if (e.activeMatchOrdinal > 0) {
        embedder.test.assertTrue(e.numberOfMatches >= e.activeMatchOrdinal)
        embedder.test.assertTrue(e.selectionRect.width > 0);
        embedder.test.assertTrue(e.selectionRect.height > 0);
      }
      if (e.finalUpdate) {
        if (e.canceled) {
          canceledTest = true;
        } else {
          embedder.test.assertEq(e.searchText, "cat");
          embedder.test.assertEq(e.numberOfMatches, 10);
          embedder.test.assertEq(e.activeMatchOrdinal, 1);
          embedder.test.assertTrue(canceledTest);
          embedder.test.succeed();
        }
      }
    });
    webview.find("dog");
    webview.find("dog");
    webview.find("cat");
  });
  document.body.appendChild(webview);
}
function testFindAPI_findupdate ( ) { var webview = new WebView ( ) ; webview . src = testFindPage ; var canceledTest = false ; webview . addEventListener ( 'loadstop' , function ( e ) { webview . addEventListener ( 'findupdate' , function ( e ) { if ( e . activeMatchOrdinal > 0 ) { embedder . test . assertTrue ( e . numberOfMatches >= e . activeMatchOrdinal ) embedder . test . assertTrue ( e . selectionRect . width > 0 ) ; embedder . test . assertTrue ( e . selectionRect . height > 0 ) ; } if ( e . finalUpdate ) { if ( e . canceled ) { canceledTest = true ; } else { embedder . test . assertEq ( e . searchText , "cat" ) ; embedder . test . assertEq ( e . numberOfMatches , 10 ) ; embedder . test . assertEq ( e . activeMatchOrdinal , 1 ) ; embedder . test . assertTrue ( canceledTest ) ; embedder . test . succeed ( ) ; } } } ) ; webview . find ( "dog" ) ; webview . find ( "dog" ) ; webview . find ( "cat" ) ; } ) ; document . body . appendChild ( webview ) ; }
likely because the search for "dog" compelted too quickly.
likely because the search for " dog " compelted too quickly .
// Test the |findupdate| event.