Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2238)

Side by Side Diff: android_webview/javatests/src/org/chromium/android_webview/test/WebViewMixedFindApisTest.java

Issue 10941015: [Android] Upstream the WebView find-in-page API implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.android_webview.test;
6
7 import android.test.suitebuilder.annotation.SmallTest;
8
9 import org.chromium.base.test.Feature;
10
11 /**
12 * Tests the mixed use of synchronous and asynchronous find-in-page APIs in WebV iew.
13 * Helps to spot race conditions or potential deadlocks caused by the renderer r eceiving
14 * asynchronous messages while synchronous requests are being processed.
15 */
16 public class WebViewMixedFindApisTest extends WebViewFindApisTestBase {
17
18 @SmallTest
19 @Feature({"Android-WebView", "FindInPage"})
20 public void testAsyncFindOperationsMixedWithSyncFind() throws Throwable {
21 clearMatchesOnUiThread();
22 assertEquals(4, findAllSyncOnUiThread("wood"));
23 assertEquals(4, findAllSyncOnUiThread("wood"));
24 clearMatchesOnUiThread();
25 assertEquals(4, findAllAsyncOnUiThread("wood"));
26 assertEquals(3, findNextOnUiThread(true));
27 clearMatchesOnUiThread();
28 assertEquals(4, findAllSyncOnUiThread("wood"));
29 }
30
31 @SmallTest
32 @Feature({"Android-WebView", "FindInPage"})
33 public void testInterleavedFinds() throws Throwable {
34 assertEquals(4, findAllSyncOnUiThread("wood"));
35 assertEquals(4, findAllAsyncOnUiThread("wood"));
36 assertEquals(4, findAllSyncOnUiThread("wood"));
37 assertEquals(3, findNextOnUiThread(true));
38 assertEquals(4, findAllAsyncOnUiThread("wood"));
39 assertEquals(1, findNextOnUiThread(true));
40 assertEquals(4, findAllSyncOnUiThread("wood"));
41 }
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698