| 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 android.content.Context; | 7 import android.content.Context; |
| 8 import android.test.suitebuilder.annotation.MediumTest; | 8 import android.test.suitebuilder.annotation.MediumTest; |
| 9 | 9 |
| 10 import org.chromium.base.ThreadUtils; | 10 import org.chromium.base.ThreadUtils; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 mWaiter.notifyCalled(); | 69 mWaiter.notifyCalled(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 @Override | 72 @Override |
| 73 public void onGotManifestData(WebApkInfo fetchedInfo, String bestIconUrl
) { | 73 public void onGotManifestData(WebApkInfo fetchedInfo, String bestIconUrl
) { |
| 74 super.onGotManifestData(fetchedInfo, bestIconUrl); | 74 super.onGotManifestData(fetchedInfo, bestIconUrl); |
| 75 mWaiter.notifyCalled(); | 75 mWaiter.notifyCalled(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 @Override | 78 @Override |
| 79 protected void updateAsync(WebApkInfo fetchedInfo, String bestIconUrl) { | 79 protected void updateAsync(WebApkInfo fetchedInfo, String bestIconUrl, |
| 80 boolean staleManifest) { |
| 80 mNeedsUpdate = true; | 81 mNeedsUpdate = true; |
| 81 } | 82 } |
| 82 | 83 |
| 83 public boolean needsUpdate() { | 84 public boolean needsUpdate() { |
| 84 return mNeedsUpdate; | 85 return mNeedsUpdate; |
| 85 } | 86 } |
| 86 } | 87 } |
| 87 | 88 |
| 88 private static class CreationData { | 89 private static class CreationData { |
| 89 public String manifestUrl; | 90 public String manifestUrl; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // URL canonicalization should replace "%62" with 'b'. | 191 // URL canonicalization should replace "%62" with 'b'. |
| 191 CreationData creationData = defaultCreationData(mTestServer); | 192 CreationData creationData = defaultCreationData(mTestServer); |
| 192 creationData.startUrl = mTestServer.getURL( | 193 creationData.startUrl = mTestServer.getURL( |
| 193 "/chrome/test/data/banners/manifest_%62est_page.html"); | 194 "/chrome/test/data/banners/manifest_%62est_page.html"); |
| 194 | 195 |
| 195 WebappTestPage.navigateToPageWithServiceWorkerAndManifest( | 196 WebappTestPage.navigateToPageWithServiceWorkerAndManifest( |
| 196 mTestServer, mTab, WEBAPK_MANIFEST_URL); | 197 mTestServer, mTab, WEBAPK_MANIFEST_URL); |
| 197 assertTrue(checkUpdateNeeded(creationData)); | 198 assertTrue(checkUpdateNeeded(creationData)); |
| 198 } | 199 } |
| 199 } | 200 } |
| OLD | NEW |