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

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

Issue 1707083002: Fix find in page behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android_webview test Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/TextFinder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.android_webview.test; 5 package org.chromium.android_webview.test;
6 6
7 import android.test.suitebuilder.annotation.SmallTest; 7 import android.test.suitebuilder.annotation.SmallTest;
8 8
9 import org.chromium.base.test.util.Feature; 9 import org.chromium.base.test.util.Feature;
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 assertEquals(4, findAllAsyncOnUiThread("wood")); 106 assertEquals(4, findAllAsyncOnUiThread("wood"));
107 clearMatchesOnUiThread(); 107 clearMatchesOnUiThread();
108 } 108 }
109 109
110 @SmallTest 110 @SmallTest
111 @Feature({"AndroidWebView", "FindInPage"}) 111 @Feature({"AndroidWebView", "FindInPage"})
112 public void testClearFindNext() throws Throwable { 112 public void testClearFindNext() throws Throwable {
113 assertEquals(4, findAllAsyncOnUiThread("wood")); 113 assertEquals(4, findAllAsyncOnUiThread("wood"));
114 clearMatchesOnUiThread(); 114 clearMatchesOnUiThread();
115 assertEquals(4, findAllAsyncOnUiThread("wood")); 115 assertEquals(4, findAllAsyncOnUiThread("wood"));
116 assertEquals(2, findNextOnUiThread(true)); 116 assertEquals(1, findNextOnUiThread(true));
117 } 117 }
118 118
119 @SmallTest 119 @SmallTest
120 @Feature({"AndroidWebView", "FindInPage"}) 120 @Feature({"AndroidWebView", "FindInPage"})
121 public void testFindEmptyNext() throws Throwable { 121 public void testFindEmptyNext() throws Throwable {
122 assertEquals(0, findAllAsyncOnUiThread("")); 122 assertEquals(0, findAllAsyncOnUiThread(""));
123 assertEquals(0, findNextOnUiThread(true)); 123 assertEquals(0, findNextOnUiThread(true));
124 assertEquals(4, findAllAsyncOnUiThread("wood")); 124 assertEquals(4, findAllAsyncOnUiThread("wood"));
125 } 125 }
126 126
127 @SmallTest 127 @SmallTest
128 @Feature({"AndroidWebView", "FindInPage"}) 128 @Feature({"AndroidWebView", "FindInPage"})
129 public void testFindNextFirst() throws Throwable { 129 public void testFindNextFirst() throws Throwable {
130 runTestOnUiThread(new Runnable() { 130 runTestOnUiThread(new Runnable() {
131 @Override 131 @Override
132 public void run() { 132 public void run() {
133 contents().findNext(true); 133 contents().findNext(true);
134 } 134 }
135 }); 135 });
136 assertEquals(4, findAllAsyncOnUiThread("wood")); 136 assertEquals(4, findAllAsyncOnUiThread("wood"));
137 assertEquals(1, findNextOnUiThread(true)); 137 assertEquals(1, findNextOnUiThread(true));
138 assertEquals(0, findNextOnUiThread(false)); 138 assertEquals(0, findNextOnUiThread(false));
139 assertEquals(3, findNextOnUiThread(false)); 139 assertEquals(3, findNextOnUiThread(false));
140 } 140 }
141 } 141 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/TextFinder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698