| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |