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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java

Issue 2228273002: Run ShortcutHelper::AddToLauncherInBackgroundWithSkBitmap() on Worker thread instead of IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_builder_impl2_thread Created 4 years, 4 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
Index: chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java
index 2ec5cc840a3a5ec5a265475e62cb0a0c2d55da44..09b1db30ca39711503277da00bff76baded804f6 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java
@@ -10,10 +10,10 @@ import static org.junit.Assert.assertTrue;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.os.AsyncTask;
import android.text.TextUtils;
import org.chromium.base.test.util.Feature;
-import org.chromium.blink_public.platform.WebDisplayMode;
import org.chromium.chrome.browser.ShortcutHelper;
import org.chromium.chrome.browser.browsing_data.UrlFilters;
import org.chromium.testing.local.BackgroundShadowAsyncTask;
@@ -749,10 +749,14 @@ public class WebappRegistryTest {
WebappRegistry.KEY_WEBAPP_SET, Collections.<String>emptySet());
}
- private Intent createShortcutIntent(String url) {
- return ShortcutHelper.createWebappShortcutIntent("id", "action", url,
- ShortcutHelper.getScopeFromUrl(url), "name", "shortName", null,
- ShortcutHelper.WEBAPP_SHORTCUT_VERSION, WebDisplayMode.Standalone, 0, 0, 0, false);
+ private Intent createShortcutIntent(final String url) throws Exception {
+ AsyncTask<Void, Void, Intent> shortcutIntentTask = new AsyncTask<Void, Void, Intent>() {
+ @Override
+ protected Intent doInBackground(Void... nothing) {
+ return ShortcutHelper.createWebappShortcutIntentForTesting("id", url);
+ }
+ };
+ return shortcutIntentTask.execute().get();
}
private Intent createWebApkIntent(String webappId, String webApkPackage) {

Powered by Google App Engine
This is Rietveld 408576698