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

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

Issue 2779593003: [Android Tests] Preload Calendar to avoid StrictMode violations (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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/ChromeActivityTestCaseBase.java
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestCaseBase.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestCaseBase.java
index 80616dabc89670d15eb9c0836dc47d59f4c1ac6f..725048b20a738a0c80dc3698b1d1cc99e172b3ea 100644
--- a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestCaseBase.java
+++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestCaseBase.java
@@ -71,6 +71,7 @@
import java.io.File;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
+import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -141,6 +142,11 @@ protected void setUp() throws Exception {
Thread.setDefaultUncaughtExceptionHandler(new ChromeUncaughtExceptionHandler());
ApplicationTestUtils.setUp(getInstrumentation().getTargetContext(), !mSkipClearAppData);
setActivityInitialTouchMode(false);
+
+ // Preload Calendar so that it does not trigger ReadFromDisk Strict mode violations if
+ // called on the UI Thread. See https://crbug.com/705477 and https://crbug.com/577185
+ Calendar.getInstance();
+
startMainActivity();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698