| OLD | NEW |
| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return mDestroyedManifestUpgradeDetector; | 123 return mDestroyedManifestUpgradeDetector; |
| 124 } | 124 } |
| 125 | 125 |
| 126 @Override | 126 @Override |
| 127 protected ManifestUpgradeDetector buildManifestUpgradeDetector(Tab tab,
WebApkInfo info) { | 127 protected ManifestUpgradeDetector buildManifestUpgradeDetector(Tab tab,
WebApkInfo info) { |
| 128 mUpgradeDetector = new TestManifestUpgradeDetector(tab, info, this); | 128 mUpgradeDetector = new TestManifestUpgradeDetector(tab, info, this); |
| 129 return mUpgradeDetector; | 129 return mUpgradeDetector; |
| 130 } | 130 } |
| 131 | 131 |
| 132 @Override | 132 @Override |
| 133 protected void updateAsync(WebApkInfo info, String bestIconUrl) { | 133 protected void updateAsync(WebApkInfo info, String bestIconUrl, boolean
staleManifest) { |
| 134 ++mNumUpdatesRequested; | 134 ++mNumUpdatesRequested; |
| 135 mUpdateName = info.name(); | 135 mUpdateName = info.name(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 @Override | 138 @Override |
| 139 protected void destroyUpgradeDetector() { | 139 protected void destroyUpgradeDetector() { |
| 140 mUpgradeDetector = null; | 140 mUpgradeDetector = null; |
| 141 mDestroyedManifestUpgradeDetector = true; | 141 mDestroyedManifestUpgradeDetector = true; |
| 142 } | 142 } |
| 143 | 143 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 updateIfNeeded(updateManager); | 469 updateIfNeeded(updateManager); |
| 470 updateManager.onFinishedFetchingWebManifestForInitialUrl(false, null, nu
ll); | 470 updateManager.onFinishedFetchingWebManifestForInitialUrl(false, null, nu
ll); |
| 471 updateManager.onGotManifestData(false, fetchedWebApkInfo(), null); | 471 updateManager.onGotManifestData(false, fetchedWebApkInfo(), null); |
| 472 assertFalse(updateManager.updateRequested()); | 472 assertFalse(updateManager.updateRequested()); |
| 473 | 473 |
| 474 // We got the Web Manifest. The {@link ManifestUpgradeDetector} should b
e destroyed to stop | 474 // We got the Web Manifest. The {@link ManifestUpgradeDetector} should b
e destroyed to stop |
| 475 // it from fetching the Web Manifest for subsequent page loads. | 475 // it from fetching the Web Manifest for subsequent page loads. |
| 476 assertTrue(updateManager.destroyedManifestUpgradeDetector()); | 476 assertTrue(updateManager.destroyedManifestUpgradeDetector()); |
| 477 } | 477 } |
| 478 } | 478 } |
| OLD | NEW |