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

Unified Diff: content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java

Issue 2082783002: Add all content_junit tests to GN config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « content/public/android/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java
diff --git a/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java b/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java
index 43688db63914d270f3947a784c0eb691b3bd34a9..22d3a47eae9f44843cf85a1e2233a92e75fe0fd4 100644
--- a/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java
+++ b/content/public/android/junit/src/org/chromium/content/browser/input/ThreadedInputConnectionTest.java
@@ -13,8 +13,11 @@ import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.when;
+import android.content.Context;
import android.os.Handler;
import android.view.KeyCharacterMap;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;
@@ -38,6 +41,8 @@ public class ThreadedInputConnectionTest {
ThreadedInputConnection mConnection;
InOrder mInOrder;
+ View mView;
+ Context mContext;
@Before
public void setUp() throws Exception {
@@ -45,8 +50,15 @@ public class ThreadedInputConnectionTest {
mImeAdapter = Mockito.mock(ImeAdapter.class);
mInOrder = inOrder(mImeAdapter);
+
+ // Mocks required to create a ThreadedInputConnection object
+ mView = Mockito.mock(View.class);
+ mContext = Mockito.mock(Context.class);
+ when(mView.getContext()).thenReturn(mContext);
+ when(mContext.getSystemService(Context.INPUT_METHOD_SERVICE)).thenReturn(Mockito.mock(
+ InputMethodManager.class));
// Let's create Handler for test thread and pretend that it is running on IME thread.
- mConnection = new ThreadedInputConnection(mImeAdapter, new Handler());
+ mConnection = new ThreadedInputConnection(mView, mImeAdapter, new Handler());
}
@Test
« no previous file with comments | « content/public/android/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698