| OLD | NEW |
| (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 } |
| OLD | NEW |