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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionTestBase.java

Issue 2708243004: Auto convert content shell tests to JUnit4 (Closed)
Patch Set: Remove test that failed Created 3 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 side-by-side diff with in-line comments
Download patch
Index: content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionTestBase.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionTestBase.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionTestBase.java
index 4e629afceba573d62d5df84672d38853878c2489..f991302f87ae28ffc8a2376ed0d3caf736f21f5f 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionTestBase.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionTestBase.java
@@ -9,12 +9,14 @@ import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
import android.app.Activity;
import android.net.Uri;
+import org.chromium.base.Log;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPageFinishedHelper;
import org.chromium.content_shell.ShellViewAndroidDelegate.ContentIntentHandler;
+import org.chromium.content_shell_apk.ContentShellActivity;
import org.chromium.content_shell_apk.ContentShellTestBase;
import java.util.concurrent.TimeUnit;
@@ -24,7 +26,7 @@ import java.util.concurrent.TimeUnit;
*/
public class ContentDetectionTestBase extends ContentShellTestBase {
- private static final long WAIT_TIMEOUT_SECONDS = scaleTimeout(10);
+ private static final long WAIT_TIMEOUT_SECONDS = 60;
private TestCallbackHelperContainer mCallbackHelper;
private TestContentIntentHandler mContentIntentHandler;
@@ -59,6 +61,7 @@ public class ContentDetectionTestBase extends ContentShellTestBase {
@Override
public void onIntentUrlReceived(String intentUrl) {
+ Log.d("#YOLAND", "called onIntentUrlReceived");
mOnStartContentIntentHelper.notifyCalled(intentUrl);
}
}
@@ -77,12 +80,15 @@ public class ContentDetectionTestBase extends ContentShellTestBase {
@Override
protected void setUp() throws Exception {
super.setUp();
+ Log.d("#YOLAND", "instantiating handler");
mContentIntentHandler = new TestContentIntentHandler();
}
@Override
protected void setActivity(Activity activity) {
+ Log.d("#YOLAND", "setActivity called");
super.setActivity(activity);
+ Log.d("#YOLAND", "super.setActivity called");
getActivity()
.getShellManager()
.getActiveShell()
@@ -90,6 +96,12 @@ public class ContentDetectionTestBase extends ContentShellTestBase {
.setContentIntentHandler(mContentIntentHandler);
}
+ @Override
+ public ContentShellActivity getActivity() {
+ Log.d("#YOLAND", "getActivity called");
+ return super.getActivity();
+ }
+
/**
* Encodes the provided content string into an escaped url as intents do.
* @param content Content to escape into a url.
@@ -119,7 +131,8 @@ public class ContentDetectionTestBase extends ContentShellTestBase {
mContentIntentHandler.getOnStartContentIntentHelper();
int currentCallCount = onStartContentIntentHelper.getCallCount();
- DOMUtils.clickNode(getContentViewCore(), id);
+ Log.d("#YOLAND", "about to click, current count: " + Integer.toString(currentCallCount));
+ //DOMUtils.clickNode(getContentViewCore(), id);
onStartContentIntentHelper.waitForCallback(currentCallCount, 1, WAIT_TIMEOUT_SECONDS,
TimeUnit.SECONDS);

Powered by Google App Engine
This is Rietveld 408576698