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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java

Issue 131743020: [android_webivew] Refactor polling checks in test code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
index a85c1d4d56b5497f684fdcecf473fb3206ee8230..a50a15146bec58dc6f07c9ee941681d44ede8b4b 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java
@@ -18,6 +18,9 @@ import org.chromium.net.test.util.TestWebServer;
import java.util.concurrent.Callable;
+/**
+ * Navigation history tests.
+ */
public class NavigationHistoryTest extends AwTestBase {
private static final String PAGE_1_PATH = "/page1.html";
@@ -281,34 +284,34 @@ public class NavigationHistoryTest extends AwTestBase {
getAwSettingsOnUiThread(mAwContents).setJavaScriptEnabled(true);
loadUrlSync(mAwContents, onPageFinishedHelper, loginPageUrl);
// Since the page performs an async action, we can't rely on callbacks.
- assertTrue(pollOnUiThread(new Callable<Boolean>() {
+ pollOnUiThread(new Callable<Boolean>() {
@Override
public Boolean call() {
String title = mAwContents.getContentViewCore().getTitle();
return LOGIN_RESPONSE_PAGE_TITLE.equals(title);
}
- }));
+ });
executeJavaScriptAndWaitForResult(mAwContents,
mContentsClient,
"link = document.getElementById('" + LOGIN_RESPONSE_PAGE_HELP_LINK_ID + "');" +
"link.click();");
- assertTrue(pollOnUiThread(new Callable<Boolean>() {
+ pollOnUiThread(new Callable<Boolean>() {
@Override
public Boolean call() {
String title = mAwContents.getContentViewCore().getTitle();
return PAGE_1_TITLE.equals(title);
}
- }));
+ });
// Verify that we can still go back to the login response page despite that
// it is non-cacheable.
HistoryUtils.goBackSync(getInstrumentation(), mAwContents.getContentViewCore(),
onPageFinishedHelper);
- assertTrue(pollOnUiThread(new Callable<Boolean>() {
+ pollOnUiThread(new Callable<Boolean>() {
@Override
public Boolean call() {
String title = mAwContents.getContentViewCore().getTitle();
return LOGIN_RESPONSE_PAGE_TITLE.equals(title);
}
- }));
+ });
}
}

Powered by Google App Engine
This is Rietveld 408576698