OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.webapps; | 5 package org.chromium.chrome.browser.webapps; |
6 | 6 |
7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; | 7 import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
8 | 8 |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.net.Uri; | 10 import android.net.Uri; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 return intent; | 88 return intent; |
89 } | 89 } |
90 | 90 |
91 @Override | 91 @Override |
92 protected void setUp() throws Exception { | 92 protected void setUp() throws Exception { |
93 super.setUp(); | 93 super.setUp(); |
94 | 94 |
95 // Register the webapp so when the data storage is opened, the test does
n't crash. There is | 95 // Register the webapp so when the data storage is opened, the test does
n't crash. There is |
96 // no race condition with the retrieval as AsyncTasks are run sequential
ly on the background | 96 // no race condition with the retrieval as AsyncTasks are run sequential
ly on the background |
97 // thread. | 97 // thread. |
98 WebappRegistry.refreshSharedPrefsForTesting(); | 98 WebappRegistry.registerWebapp( |
99 WebappRegistry.getInstance().register( | |
100 WEBAPP_ID, new WebappRegistry.FetchWebappDataStorageCallback() { | 99 WEBAPP_ID, new WebappRegistry.FetchWebappDataStorageCallback() { |
101 @Override | 100 @Override |
102 public void onWebappDataStorageRetrieved(WebappDataStorage s
torage) { | 101 public void onWebappDataStorageRetrieved(WebappDataStorage s
torage) { |
103 storage.updateFromShortcutIntent(createIntent()); | 102 storage.updateFromShortcutIntent(createIntent()); |
104 } | 103 } |
105 }); | 104 }); |
106 } | 105 } |
107 | 106 |
108 /** | 107 /** |
109 * Starts up the WebappActivity and sets up the test observer. | 108 * Starts up the WebappActivity and sets up the test observer. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 fail(); | 215 fail(); |
217 } | 216 } |
218 | 217 |
219 ViewGroup splashScreen = getActivity().getSplashScreenForTests(); | 218 ViewGroup splashScreen = getActivity().getSplashScreenForTests(); |
220 if (splashScreen == null) { | 219 if (splashScreen == null) { |
221 fail("No splash screen available."); | 220 fail("No splash screen available."); |
222 } | 221 } |
223 return splashScreen; | 222 return splashScreen; |
224 } | 223 } |
225 } | 224 } |
OLD | NEW |