| Index: chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
|
| index 5f8337062965f173c0b715262c9b86048f0d86e0..e58a9a83e1d1c7a5a29069a76da49c07b7029e36 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
|
| @@ -12,6 +12,7 @@ import android.view.LayoutInflater;
|
| import android.view.View;
|
| import android.view.ViewGroup;
|
|
|
| +import org.chromium.base.VisibleForTesting;
|
| import org.chromium.chrome.R;
|
| import org.chromium.chrome.browser.IntentHandler;
|
| import org.chromium.chrome.browser.WebContentsFactory;
|
| @@ -33,6 +34,9 @@ import org.chromium.ui.base.ActivityWindowAndroid;
|
| /** Queries the user's default search engine and shows autocomplete suggestions. */
|
| public class SearchActivity extends AsyncInitializationActivity
|
| implements SnackbarManageable, SearchActivityLocationBarLayout.Delegate {
|
| + /** Setting this field causes the Activity to finish itself immediately for tests. */
|
| + private static boolean sIsDisabledForTest;
|
| +
|
| /** Main content view. */
|
| private ViewGroup mContentView;
|
|
|
| @@ -50,6 +54,12 @@ public class SearchActivity extends AsyncInitializationActivity
|
| private Tab mTab;
|
|
|
| @Override
|
| + protected boolean isStartedUpCorrectly(Intent intent) {
|
| + if (sIsDisabledForTest) return false;
|
| + return true;
|
| + }
|
| +
|
| + @Override
|
| public void backKeyPressed() {
|
| cancelSearch();
|
| }
|
| @@ -205,4 +215,10 @@ public class SearchActivity extends AsyncInitializationActivity
|
| finish();
|
| overridePendingTransition(0, R.anim.activity_close_exit);
|
| }
|
| +
|
| + /** See {@link #sIsDisabledForTest}. */
|
| + @VisibleForTesting
|
| + static void disableForTests() {
|
| + sIsDisabledForTest = true;
|
| + }
|
| }
|
|
|