Index: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java |
index c8bfaf16e53b5bc571af7951595c7de52b840620..72a04ed5d6bacf35b35fb93d3c516b6c68c4dad2 100644 |
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java |
@@ -107,6 +107,17 @@ public class WebappModeTest extends MultiActivityTestBase { |
ApplicationTestUtils.waitUntilChromeInForeground(); |
} |
+ @Override |
+ public void setUp() throws Exception { |
+ super.setUp(); |
+ |
+ // Register the webapps so when the data storage is opened, the test doesn't crash. There is |
+ // no race condition with the retrival as AsyncTasks are run sequentially on the background |
+ // thread. |
+ WebappRegistry.registerWebapp(getInstrumentation().getTargetContext(), WEBAPP_1_ID); |
+ WebappRegistry.registerWebapp(getInstrumentation().getTargetContext(), WEBAPP_2_ID); |
+ } |
+ |
/** |
* Tests that WebappActivities are started properly. |
*/ |