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

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

Issue 1987813004: MD Settings: About page, implementing update status. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test, after changing "=" to "$=" Created 4 years, 7 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
« no previous file with comments | « chrome/browser/resources/settings/icons.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6a0b7bb2da1af4f37a03c4255ff124cffd3849de..9a7fb7bcfd1e54271be57dc8c688249d12c06bc7 100644
--- a/chrome/test/data/webui/settings/about_page_tests.js
+++ b/chrome/test/data/webui/settings/about_page_tests.js
@@ -15,6 +15,7 @@ cr.define('settings_about_page', function() {
'openHelpPage',
'openFeedbackDialog',
'getCurrentChannel',
+ 'getTargetChannel',
'getVersionInfo',
]);
@@ -51,6 +52,12 @@ cr.define('settings_about_page', function() {
},
/** @override */
+ getTargetChannel: function() {
+ this.methodCalled('getTargetChannel');
+ return Promise.resolve(BrowserChannel.BETA);
+ },
+
+ /** @override */
getVersionInfo: function() {
this.methodCalled('getVersionInfo');
return Promise.resolve(this.versionInfo_);
@@ -78,6 +85,53 @@ cr.define('settings_about_page', function() {
PolymerTest.clearBody();
page = document.createElement('settings-about-page');
document.body.appendChild(page);
+ return browserProxy.whenCalled('refreshUpdateStatus');
+ });
+
+ /**
+ * Test that the status icon updates according to incoming
+ * 'update-status-chanhed' events.
+ */
+ test('IconUpdates', function() {
+ function fireStatusChanged(status) {
+ cr.webUIListenerCallback('update-status-changed', {
+ status: status, message: '', progress: 0,
+ });
+ }
+
+ var SPINNER_ICON = 'chrome://resources/images/throbber_small.svg';
+
+ var icon = page.$$('iron-icon');
+ assertTrue(!!icon);
+ assertEquals(null, icon.getAttribute('icon'));
+
+ fireStatusChanged(UpdateStatus.CHECKING);
+ assertEquals(SPINNER_ICON, icon.src);
+ assertEquals(null, icon.getAttribute('icon'));
+
+ fireStatusChanged(UpdateStatus.UPDATING);
+ assertEquals(SPINNER_ICON, icon.src);
+ assertEquals(null, icon.getAttribute('icon'));
+
+ fireStatusChanged(UpdateStatus.NEARLY_UPDATED);
+ assertEquals(null, icon.src);
+ assertEquals('settings:check-circle', icon.icon);
+
+ fireStatusChanged(UpdateStatus.NEARLY_UPDATED);
+ assertEquals(null, icon.src);
+ assertEquals('settings:check-circle', icon.icon);
+
+ fireStatusChanged(UpdateStatus.DISABLED_BY_ADMIN);
+ assertEquals(null, icon.src);
+ assertEquals('cr:domain', icon.icon);
+
+ fireStatusChanged(UpdateStatus.FAILED);
+ assertEquals(null, icon.src);
+ assertEquals('settings:error', icon.icon);
+
+ fireStatusChanged(UpdateStatus.DISABLED);
+ assertEquals(null, icon.src);
+ assertEquals(null, icon.getAttribute('icon'));
});
test('GetHelp', function() {
« no previous file with comments | « chrome/browser/resources/settings/icons.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698