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

Unified Diff: chrome/test/android/javatests/src/org/chromium/chrome/test/util/TranslateUtil.java

Issue 2831823003: Convert ChromeActivityTestCaseBase direct children to JUnit4 (Closed)
Patch Set: rebase and convert newly added test Created 3 years, 8 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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/widget/ToolbarProgressBarTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/android/javatests/src/org/chromium/chrome/test/util/TranslateUtil.java
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/TranslateUtil.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/TranslateUtil.java
index 7dff3676ff26e352b817bcdb1d0f3c9c5cd4d03d..e64931ca367a5aa8039fa1fcfb76542eead4b7e8 100644
--- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/TranslateUtil.java
+++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/TranslateUtil.java
@@ -4,13 +4,14 @@
package org.chromium.chrome.test.util;
-import android.test.ActivityInstrumentationTestCase2;
+import android.app.Activity;
+import android.app.Instrumentation;
import android.text.SpannableString;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.infobar.InfoBar;
@@ -25,11 +26,9 @@ import org.chromium.content.browser.test.util.TestTouchUtils;
public class TranslateUtil {
/**
* Finds the first clickable span inside a TextView and clicks it.
- *
- * @return True if the panel is opened.
*/
- public static void openLanguagePanel(ActivityInstrumentationTestCase2<?> test,
- InfoBar infoBar) {
+ public static void openLanguagePanel(
+ Instrumentation instrumentation, Activity activity, InfoBar infoBar) {
View view = infoBar.getView().findViewById(R.id.infobar_message);
Assert.assertNotNull(view);
@@ -52,10 +51,9 @@ public class TranslateUtil {
float xPos = text.getPaddingLeft() + (sizePerChar * x);
float yPos = text.getHeight() / (float) 2;
- TestTouchUtils.singleClickView(test.getInstrumentation(), text, (int) xPos, (int) yPos);
+ TestTouchUtils.singleClickView(instrumentation, text, (int) xPos, (int) yPos);
- assertInfoBarText(infoBar, test.getActivity().getString(
- R.string.translate_infobar_change_languages));
+ assertInfoBarText(infoBar, activity.getString(R.string.translate_infobar_change_languages));
}
public static void assertInfoBarText(InfoBar infoBar, String expectedText) {
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/widget/ToolbarProgressBarTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698