Merge "Fix tests that require the screen to be on."
diff --git a/tests/src/com/android/contacts/list/ContactListItemViewTest.java b/tests/src/com/android/contacts/list/ContactListItemViewTest.java
index ccd2fb5..8372f96 100644
--- a/tests/src/com/android/contacts/list/ContactListItemViewTest.java
+++ b/tests/src/com/android/contacts/list/ContactListItemViewTest.java
@@ -19,6 +19,7 @@
import com.android.contacts.activities.PeopleActivity;
import com.android.contacts.format.SpannedTestUtils;
import com.android.contacts.format.TestTextWithHighlightingFactory;
+import com.android.contacts.util.IntegrationTestUtils;
import android.database.Cursor;
import android.database.MatrixCursor;
@@ -40,10 +41,26 @@
/** The HTML code used to mark the end of the highlighted part. */
private static final String END = "</font>";
+ private IntegrationTestUtils mUtils;
+
public ContactListItemViewTest() {
super(PeopleActivity.class);
}
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ // This test requires that the screen be turned on.
+ mUtils = new IntegrationTestUtils(getInstrumentation());
+ mUtils.acquireScreenWakeLock(getInstrumentation().getTargetContext());
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ mUtils.releaseScreenWakeLock();
+ super.tearDown();
+ }
+
public void testShowDisplayName_Simple() {
Cursor cursor = createCursor("John Doe", "Doe John");
ContactListItemView view = createView();