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

Side by Side Diff: chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java

Issue 2758193002: [Android WebAPKs] Don't navigate WebAPK when launching it from launcher (Closed)
Patch Set: Merge branch 'package_name2' into twitter 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.junit.Assert.assertEquals; 7 import static org.junit.Assert.assertEquals;
8 import static org.junit.Assert.assertFalse; 8 import static org.junit.Assert.assertFalse;
9 import static org.junit.Assert.assertTrue; 9 import static org.junit.Assert.assertTrue;
10 10
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 manifestData.displayMode = DISPLAY_MODE; 244 manifestData.displayMode = DISPLAY_MODE;
245 manifestData.orientation = ORIENTATION; 245 manifestData.orientation = ORIENTATION;
246 manifestData.themeColor = THEME_COLOR; 246 manifestData.themeColor = THEME_COLOR;
247 manifestData.backgroundColor = BACKGROUND_COLOR; 247 manifestData.backgroundColor = BACKGROUND_COLOR;
248 return manifestData; 248 return manifestData;
249 } 249 }
250 250
251 private static WebApkInfo infoFromManifestData(ManifestData manifestData) { 251 private static WebApkInfo infoFromManifestData(ManifestData manifestData) {
252 if (manifestData == null) return null; 252 if (manifestData == null) return null;
253 253
254 return WebApkInfo.create(WEBAPK_ID, "", manifestData.scopeUrl, 254 return WebApkInfo.create(WEBAPK_ID, "", false, manifestData.scopeUrl,
dominickn 2017/03/21 02:09:33 /* forceNavigation */
255 new WebApkInfo.Icon(manifestData.bestIcon), manifestData.name, 255 new WebApkInfo.Icon(manifestData.bestIcon), manifestData.name,
256 manifestData.shortName, manifestData.displayMode, manifestData.o rientation, -1, 256 manifestData.shortName, manifestData.displayMode, manifestData.o rientation, -1,
257 manifestData.themeColor, manifestData.backgroundColor, 257 manifestData.themeColor, manifestData.backgroundColor,
258 WebApkTestHelper.WEBAPK_PACKAGE_NAME, -1, WEB_MANIFEST_URL, 258 WebApkTestHelper.WEBAPK_PACKAGE_NAME, -1, WEB_MANIFEST_URL, mani festData.startUrl,
259 manifestData.startUrl, manifestData.iconUrlToMurmur2HashMap); 259 manifestData.iconUrlToMurmur2HashMap);
260 } 260 }
261 261
262 /** 262 /**
263 * Creates 1x1 bitmap. 263 * Creates 1x1 bitmap.
264 * @param color The bitmap color. 264 * @param color The bitmap color.
265 */ 265 */
266 private static Bitmap createBitmap(int color) { 266 private static Bitmap createBitmap(int color) {
267 int colors[] = { color }; 267 int colors[] = { color };
268 return ShadowBitmap.createBitmap(colors, 1, 1, Bitmap.Config.ALPHA_8); 268 return ShadowBitmap.createBitmap(colors, 1, 1, Bitmap.Config.ALPHA_8);
269 } 269 }
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 // Since {@link WebApkActivity#OnStop()} calls {@link requestPendingUpda te()} to trigger an 719 // Since {@link WebApkActivity#OnStop()} calls {@link requestPendingUpda te()} to trigger an
720 // update request, we call it directly for testing. 720 // update request, we call it directly for testing.
721 updateManager.setIsWebApkForeground(false); 721 updateManager.setIsWebApkForeground(false);
722 updateManager.requestPendingUpdate(); 722 updateManager.requestPendingUpdate();
723 723
724 assertFalse(updateManager.getHasPendingUpdateForTesting()); 724 assertFalse(updateManager.getHasPendingUpdateForTesting());
725 assertTrue(updateManager.updateRequested()); 725 assertTrue(updateManager.updateRequested());
726 assertEquals(0, storage.getUpdateRequests()); 726 assertEquals(0, storage.getUpdateRequests());
727 } 727 }
728 } 728 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698