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

Unified Diff: content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java

Issue 11280250: Add waitUntilHasValue() to simplify usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase.. Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java
index c9fbf428800a121650c2531859f90265955717bc..679401a38e4d480607be2faae71321d495ea9c21 100644
--- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java
+++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java
@@ -56,14 +56,13 @@ public class JavaScriptUtils {
final String code,
final long timeout, final TimeUnit timeoutUnits)
throws InterruptedException, TimeoutException {
- int currentCallCount = helper.getCallCount();
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
helper.evaluateJavaScript(viewCore, code);
}
});
- helper.waitForCallback(currentCallCount, 1, timeout, timeoutUnits);
+ helper.waitUntilHasValue(timeout, timeoutUnits);
Assert.assertTrue("Failed to retrieve JavaScript evaluation results.", helper.hasValue());
return helper.getJsonResultAndClear();
}

Powered by Google App Engine
This is Rietveld 408576698