| 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() {
|
|
|