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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionActivityTestRule.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/ContentDetectionActivityTestRule.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionActivityTestRule.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionActivityTestRule.java
index b0be0f1dd7b664d10a4282eab749341b552b4e5f..81389078b32d200084cc8bba8e3bbaf977fb8141 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionActivityTestRule.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentDetectionActivityTestRule.java
@@ -9,6 +9,9 @@ import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
import android.net.Uri;
import android.support.test.InstrumentationRegistry;
+import org.junit.Assert;
+
+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;
@@ -23,7 +26,7 @@ import java.util.concurrent.TimeUnit;
* ActivityTestRule for content detection test suites.
*/
public class ContentDetectionActivityTestRule extends ContentShellActivityTestRule {
- private static final long WAIT_TIMEOUT_SECONDS = scaleTimeout(10);
+ private static final long WAIT_TIMEOUT_SECONDS = 60;
private TestCallbackHelperContainer mCallbackHelper;
private TestContentIntentHandler mContentIntentHandler;
@@ -58,6 +61,7 @@ public class ContentDetectionActivityTestRule extends ContentShellActivityTestRu
@Override
public void onIntentUrlReceived(String intentUrl) {
+ Log.d("#YOLAND", "called onIntentUrlReceived");
jbudorick 2017/03/01 23:10:19 :) I'm assuming that your intention was to remove
the real yoland 2017/03/08 23:35:31 lol, just did Done
mOnStartContentIntentHelper.notifyCalled(intentUrl);
}
}
@@ -75,12 +79,15 @@ public class ContentDetectionActivityTestRule extends ContentShellActivityTestRu
@Override
protected void beforeActivityLaunched() {
+ Log.d("#YOLAND", "beforeActivityLaunched called");
super.beforeActivityLaunched();
mContentIntentHandler = new TestContentIntentHandler();
+ Log.d("#YOLAND", "instantiating handler");
}
@Override
protected void afterActivityLaunched() {
+ Log.d("#YOLAND", "afterActivityLaunched called");
getActivity()
.getShellManager()
.getActiveShell()
@@ -113,11 +120,19 @@ public class ContentDetectionActivityTestRule extends ContentShellActivityTestRu
* @return The content url of the received intent or null if none.
*/
public String scrollAndTapExpectingIntent(String id) throws Throwable {
- OnStartContentIntentHelper onStartContentIntentHelper =
+ ContentIntentHandler handler = getActivity()
+ .getShellManager()
+ .getActiveShell()
+ .getViewAndroidDelegate()
+ .getContentIntentHandler();
+ Log.d("#YOLAND", "hander one is " + handler.toString() + " handler two is " + mContentIntentHandler.toString());
+ Assert.assertEquals(handler, mContentIntentHandler);
+ OnStartContentIntentHelper onStartContentIntentHelper =
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