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

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

Issue 2029453002: MD Settings: About page, implement obsolete/end-of-the-line status. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comment. 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/ui/webui/settings/about_handler.cc ('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 b186eac082386ea3cf1940ca69b96aa0f17b7604..60c255c4cb483e5602bac8ede1801c5e6b6afa62 100644
--- a/chrome/test/data/webui/settings/about_page_tests.js
+++ b/chrome/test/data/webui/settings/about_page_tests.js
@@ -144,6 +144,7 @@ cr.define('settings_about_page', function() {
suite('AboutPageTest', function() {
var page = null;
var browserProxy = null;
+ var SPINNER_ICON = 'chrome://resources/images/throbber_small.svg';
setup(function() {
browserProxy = new TestAboutPageBrowserProxy();
@@ -151,6 +152,15 @@ cr.define('settings_about_page', function() {
return initNewPage();
});
+ teardown(function() {
+ page.remove();
+ page = null;
+ loadTimeData.overrideValues({
+ aboutObsoleteNowOrSoon: false,
+ aboutObsoleteEndOfTheLine: false,
+ });
+ });
+
/** @return {!Promise} */
function initNewPage() {
browserProxy.reset();
@@ -165,8 +175,6 @@ cr.define('settings_about_page', function() {
* 'update-status-changed' events.
*/
test('IconUpdates', function() {
- var SPINNER_ICON = 'chrome://resources/images/throbber_small.svg';
-
var icon = page.$$('iron-icon');
assertTrue(!!icon);
@@ -199,6 +207,84 @@ cr.define('settings_about_page', function() {
assertEquals(null, icon.getAttribute('icon'));
});
+ /**
+ * Test that when the current platform has been marked as deprecated (but
+ * not end of the line) a deprecation warning message is displayed,
+ * without interfering with the update status message and icon.
+ */
+ test('ObsoleteSystem', function() {
+ loadTimeData.overrideValues({
+ aboutObsoleteNowOrSoon: true,
+ aboutObsoleteEndOfTheLine: false,
+ });
+
+ return initNewPage().then(function() {
+ var icon = page.$$('iron-icon');
+ assertTrue(!!icon);
+ assertTrue(!!page.$.updateStatusMessage);
+ assertTrue(!!page.$.deprecationWarning);
+
+ assertFalse(page.$.deprecationWarning.hidden);
+ assertFalse(page.$.updateStatusMessage.hidden);
+
+ fireStatusChanged(UpdateStatus.CHECKING);
+ assertEquals(SPINNER_ICON, icon.src);
+ assertEquals(null, icon.getAttribute('icon'));
+ assertFalse(page.$.deprecationWarning.hidden);
+ assertFalse(page.$.updateStatusMessage.hidden);
+
+ fireStatusChanged(UpdateStatus.UPDATING);
+ assertEquals(SPINNER_ICON, icon.src);
+ assertEquals(null, icon.getAttribute('icon'));
+ assertFalse(page.$.deprecationWarning.hidden);
+ assertFalse(page.$.updateStatusMessage.hidden);
+
+ fireStatusChanged(UpdateStatus.NEARLY_UPDATED);
+ assertEquals(null, icon.src);
+ assertEquals('settings:check-circle', icon.icon);
+ assertFalse(page.$.deprecationWarning.hidden);
+ assertFalse(page.$.updateStatusMessage.hidden);
+ });
+ });
+
+ /**
+ * Test that when the current platform has reached the end of the line, a
+ * deprecation warning message and an error icon is displayed.
+ */
+ test('ObsoleteSystemEndOfLine', function() {
+ loadTimeData.overrideValues({
+ aboutObsoleteNowOrSoon: true,
+ aboutObsoleteEndOfTheLine: true,
+ });
+ return initNewPage().then(function() {
+ var icon = page.$$('iron-icon');
+ assertTrue(!!icon);
+ assertTrue(!!page.$.deprecationWarning);
+ assertTrue(!!page.$.updateStatusMessage);
+
+ assertFalse(page.$.deprecationWarning.hidden);
+ assertFalse(page.$.deprecationWarning.hidden);
+
+ fireStatusChanged(UpdateStatus.CHECKING);
+ assertEquals(null, icon.src);
+ assertEquals('settings:error', icon.icon);
+ assertFalse(page.$.deprecationWarning.hidden);
+ assertTrue(page.$.updateStatusMessage.hidden);
+
+ fireStatusChanged(UpdateStatus.FAILED);
+ assertEquals(null, icon.src);
+ assertEquals('settings:error', icon.icon);
+ assertFalse(page.$.deprecationWarning.hidden);
+ assertTrue(page.$.updateStatusMessage.hidden);
+
+ fireStatusChanged(UpdateStatus.UPDATED);
+ assertEquals(null, icon.src);
+ assertEquals('settings:error', icon.icon);
+ assertFalse(page.$.deprecationWarning.hidden);
+ assertTrue(page.$.updateStatusMessage.hidden);
+ });
+ });
+
if (cr.isChromeOS) {
/**
* Test that all buttons update according to incoming
« no previous file with comments | « chrome/browser/ui/webui/settings/about_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698