| 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) {
|
|
|