summaryrefslogtreecommitdiffstats
path: root/android_webview/javatests/src
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-08 00:31:01 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-08 00:31:01 +0000
commit2985ed758610fb7d6d3a8d2400328d3ad7383fca (patch)
tree5f4873df3edd23b5e46702fc758da989a62a650e /android_webview/javatests/src
parenta9f94bc6fc85c5d406035402e116f1ae29b0b675 (diff)
downloadchromium_src-2985ed758610fb7d6d3a8d2400328d3ad7383fca.zip
chromium_src-2985ed758610fb7d6d3a8d2400328d3ad7383fca.tar.gz
chromium_src-2985ed758610fb7d6d3a8d2400328d3ad7383fca.tar.bz2
Remove Android WebView synchronous find.
After the browser UI thread and the renderer compositor threads are merged, all synchronous calls from UI to renderer will possible deadlocks since the renderer webkit thread blocks on the compositor thread all the time. Therefore remove support for synchronous find in page which is already an deprecated API. BUG=179436 TBR=palmer@chromium.org (Only removing ipc message) Review URL: https://chromiumcodereview.appspot.com/12383030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/javatests/src')
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/WebViewMixedFindApisTest.java42
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/WebViewSynchronousFindApisTest.java142
2 files changed, 0 insertions, 184 deletions
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/WebViewMixedFindApisTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/WebViewMixedFindApisTest.java
deleted file mode 100644
index b5a7313..0000000
--- a/android_webview/javatests/src/org/chromium/android_webview/test/WebViewMixedFindApisTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.android_webview.test;
-
-import android.test.suitebuilder.annotation.SmallTest;
-
-import org.chromium.base.test.util.Feature;
-
-/**
- * Tests the mixed use of synchronous and asynchronous find-in-page APIs in WebView.
- * Helps to spot race conditions or potential deadlocks caused by the renderer receiving
- * asynchronous messages while synchronous requests are being processed.
- */
-public class WebViewMixedFindApisTest extends WebViewFindApisTestBase {
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testAsyncFindOperationsMixedWithSyncFind() throws Throwable {
- clearMatchesOnUiThread();
- assertEquals(4, findAllSyncOnUiThread("wood"));
- assertEquals(4, findAllSyncOnUiThread("wood"));
- clearMatchesOnUiThread();
- assertEquals(4, findAllAsyncOnUiThread("wood"));
- assertEquals(3, findNextOnUiThread(true));
- clearMatchesOnUiThread();
- assertEquals(4, findAllSyncOnUiThread("wood"));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testInterleavedFinds() throws Throwable {
- assertEquals(4, findAllSyncOnUiThread("wood"));
- assertEquals(4, findAllAsyncOnUiThread("wood"));
- assertEquals(4, findAllSyncOnUiThread("wood"));
- assertEquals(3, findNextOnUiThread(true));
- assertEquals(4, findAllAsyncOnUiThread("wood"));
- assertEquals(1, findNextOnUiThread(true));
- assertEquals(4, findAllSyncOnUiThread("wood"));
- }
-}
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/WebViewSynchronousFindApisTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/WebViewSynchronousFindApisTest.java
deleted file mode 100644
index d4c4859..0000000
--- a/android_webview/javatests/src/org/chromium/android_webview/test/WebViewSynchronousFindApisTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.android_webview.test;
-
-import android.test.FlakyTest;
-import android.test.suitebuilder.annotation.SmallTest;
-
-import org.chromium.base.test.util.Feature;
-
-/**
- * Tests the synchronous find-in-page APIs in WebView.
- */
-public class WebViewSynchronousFindApisTest extends WebViewFindApisTestBase {
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindAllFinds() throws Throwable {
- assertEquals(4, findAllSyncOnUiThread("wood"));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindAllDouble() throws Throwable {
- findAllSyncOnUiThread("wood");
- assertEquals(4, findAllSyncOnUiThread("chuck"));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindAllDoubleNext() throws Throwable {
- assertEquals(4, findAllSyncOnUiThread("wood"));
- assertEquals(4, findAllSyncOnUiThread("wood"));
- assertEquals(2, findNextOnUiThread(true));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindAllDoesNotFind() throws Throwable {
- assertEquals(0, findAllSyncOnUiThread("foo"));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindAllEmptyPage() throws Throwable {
- assertEquals(0, findAllSyncOnUiThread("foo"));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindAllEmptyString() throws Throwable {
- assertEquals(0, findAllSyncOnUiThread(""));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindNextForward() throws Throwable {
- assertEquals(4, findAllSyncOnUiThread("wood"));
-
- for (int i = 2; i <= 4; i++) {
- assertEquals(i - 1, findNextOnUiThread(true));
- }
- assertEquals(0, findNextOnUiThread(true));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindNextBackward() throws Throwable {
- assertEquals(4, findAllSyncOnUiThread("wood"));
-
- for (int i = 4; i >= 1; i--) {
- assertEquals(i - 1, findNextOnUiThread(false));
- }
- assertEquals(3, findNextOnUiThread(false));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindNextBig() throws Throwable {
- assertEquals(4, findAllSyncOnUiThread("wood"));
-
- assertEquals(1, findNextOnUiThread(true));
- assertEquals(0, findNextOnUiThread(false));
- assertEquals(3, findNextOnUiThread(false));
- for (int i = 1; i <= 4; i++) {
- assertEquals(i - 1, findNextOnUiThread(true));
- }
- assertEquals(0, findNextOnUiThread(true));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindAllEmptyNext() throws Throwable {
- assertEquals(4, findAllSyncOnUiThread("wood"));
- assertEquals(1, findNextOnUiThread(true));
- assertEquals(0, findAllSyncOnUiThread(""));
- assertEquals(0, findNextOnUiThread(true));
- assertEquals(0, findAllSyncOnUiThread(""));
- assertEquals(4, findAllSyncOnUiThread("wood"));
- assertEquals(1, findNextOnUiThread(true));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testClearMatches() throws Throwable {
- assertEquals(4, findAllSyncOnUiThread("wood"));
- clearMatchesOnUiThread();
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testClearFindNext() throws Throwable {
- assertEquals(4, findAllSyncOnUiThread("wood"));
- clearMatchesOnUiThread();
- assertEquals(4, findAllSyncOnUiThread("wood"));
- assertEquals(2, findNextOnUiThread(true));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindEmptyNext() throws Throwable {
- assertEquals(0, findAllSyncOnUiThread(""));
- assertEquals(0, findNextOnUiThread(true));
- assertEquals(4, findAllSyncOnUiThread("wood"));
- }
-
- @SmallTest
- @Feature({"AndroidWebView", "FindInPage"})
- public void testFindNextFirst() throws Throwable {
- runTestOnUiThread(new Runnable() {
- @Override
- public void run() {
- contents().findNext(true);
- }
- });
- assertEquals(4, findAllSyncOnUiThread("wood"));
- assertEquals(1, findNextOnUiThread(true));
- assertEquals(0, findNextOnUiThread(false));
- assertEquals(3, findNextOnUiThread(false));
- }
-}