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

Unified Diff: chrome/test/data/webui/settings/about_page_tests.js

Issue 2476353007: MD Settings: ignore 0% updates on help/about page (Closed)
Patch Set: Created 4 years, 1 month 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/test/data/webui/settings/about_page_tests.js
diff --git a/chrome/test/data/webui/settings/about_page_tests.js b/chrome/test/data/webui/settings/about_page_tests.js
index 051ae3352257f7e5ae14a61b3c511a92367e67c6..6ffdaf98f6c5744c174da12356764229d291431d 100644
--- a/chrome/test/data/webui/settings/about_page_tests.js
+++ b/chrome/test/data/webui/settings/about_page_tests.js
@@ -65,7 +65,7 @@ cr.define('settings_about_page', function() {
/** @override */
refreshUpdateStatus: function() {
cr.webUIListenerCallback('update-status-changed', {
- progress: 0,
+ progress: 1,
status: this.updateStatus_,
});
this.methodCalled('refreshUpdateStatus');
@@ -138,10 +138,13 @@ cr.define('settings_about_page', function() {
function registerAboutPageTests() {
- /** @param {!UpdateStatus} status */
- function fireStatusChanged(status) {
+ /**
+ * @param {!UpdateStatus} status
+ * @param {number=} opt_progress
+ */
+ function fireStatusChanged(status, opt_progress) {
cr.webUIListenerCallback('update-status-changed', {
- progress: 0,
+ progress: opt_progress === undefined ? 1 : opt_progress,
status: status,
});
}
@@ -202,10 +205,16 @@ cr.define('settings_about_page', function() {
assertNotEquals(previousMessageText, statusMessageEl.textContent);
previousMessageText = statusMessageEl.textContent;
- fireStatusChanged(UpdateStatus.UPDATING);
+ fireStatusChanged(UpdateStatus.UPDATING, 0);
assertEquals(SPINNER_ICON, icon.src);
assertEquals(null, icon.getAttribute('icon'));
+ assertFalse(statusMessageEl.textContent.includes('%'));
+ assertNotEquals(previousMessageText, statusMessageEl.textContent);
+ previousMessageText = statusMessageEl.textContent;
+
+ fireStatusChanged(UpdateStatus.UPDATING, 1);
assertNotEquals(previousMessageText, statusMessageEl.textContent);
+ assertTrue(statusMessageEl.textContent.includes('%'));
previousMessageText = statusMessageEl.textContent;
fireStatusChanged(UpdateStatus.NEARLY_UPDATED);

Powered by Google App Engine
This is Rietveld 408576698