Index: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java |
index 54d38c28558fc01c6c7054bb720d48db6788e403..6e38730c81daab258b4e2a5ec937d72e6515bc13 100644 |
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java |
@@ -36,6 +36,11 @@ public abstract class WebappActivityTestBase extends ChromeActivityTestCaseBase< |
protected void setUp() throws Exception { |
super.setUp(); |
+ // Register the webapp 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_ID); |
+ |
// Default to a webapp that just loads about:blank to avoid a network load. This results |
// in the URL bar showing since {@link UrlUtils} cannot parse this type of URL. |
Intent intent = new Intent(getInstrumentation().getTargetContext(), WebappActivity0.class); |