| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 java.util.concurrent.Callable; | 7 import java.util.concurrent.Callable; |
| 8 import java.util.concurrent.CountDownLatch; | 8 import java.util.concurrent.CountDownLatch; |
| 9 import java.util.concurrent.TimeUnit; | 9 import java.util.concurrent.TimeUnit; |
| 10 import java.util.concurrent.TimeoutException; | 10 import java.util.concurrent.TimeoutException; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 int numberOfMatches, boolean isDoneCounting) { | 55 int numberOfMatches, boolean isDoneCounting) { |
| 56 if (mFindResultListener == null) return; | 56 if (mFindResultListener == null) return; |
| 57 mFindResultListener.onFindResultReceived(activeMatchOrdinal, num
berOfMatches, | 57 mFindResultListener.onFindResultReceived(activeMatchOrdinal, num
berOfMatches, |
| 58 isDoneCounting); | 58 isDoneCounting); |
| 59 } | 59 } |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 final AwContents contents = | 62 final AwContents contents = |
| 63 createAwTestContainerViewOnMainSync(contentsClient).getAwContent
s(); | 63 createAwTestContainerViewOnMainSync(contentsClient).getAwContent
s(); |
| 64 final String data = "<html><head></head><body>" + html + "</body></html>
"; | 64 final String data = "<html><head></head><body>" + html + "</body></html>
"; |
| 65 loadDataSync(contents, contentsClient.getOnPageFinishedHelper(), | 65 loadDataSync(contents.getContentViewCore(), contentsClient.getOnPageFini
shedHelper(), |
| 66 data, "text/html", false); | 66 data, "text/html", false); |
| 67 return contents; | 67 return contents; |
| 68 } | 68 } |
| 69 | 69 |
| 70 /** | 70 /** |
| 71 * Invokes findAllSync on the UI thread and returns the number of matches. | 71 * Invokes findAllSync on the UI thread and returns the number of matches. |
| 72 * | 72 * |
| 73 * @param searchString A string to search for. | 73 * @param searchString A string to search for. |
| 74 * @return The number of instances of the string that were found. | 74 * @return The number of instances of the string that were found. |
| 75 * @throws Throwable | 75 * @throws Throwable |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 /** | 176 /** |
| 177 * Sets the value of this Future. | 177 * Sets the value of this Future. |
| 178 */ | 178 */ |
| 179 protected void set(int value) { | 179 protected void set(int value) { |
| 180 mValue = value; | 180 mValue = value; |
| 181 mLatch.countDown(); | 181 mLatch.countDown(); |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 } | 184 } |
| OLD | NEW |