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

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

Issue 2714883002: MD Settings: About page, show error messages with <br> and <pre> tags. (Closed)
Patch Set: Resolved conflicts. Created 3 years, 10 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/about_page/about_page.js ('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 9e02715936e0af5b9c4f21a0df5e84d0d2a953f3..32837a62be6ea8e7af82f78f0fe4a3d965bbd442 100644
--- a/chrome/test/data/webui/settings/about_page_tests.js
+++ b/chrome/test/data/webui/settings/about_page_tests.js
@@ -152,11 +152,16 @@ cr.define('settings_about_page', function() {
function registerAboutPageTests() {
/**
* @param {!UpdateStatus} status
- * @param {number=} opt_progress
+ * @param {{
+ * progress: number|undefined,
+ * message: string|undefined
+ * }} opt_options
*/
- function fireStatusChanged(status, opt_progress) {
+ function fireStatusChanged(status, opt_options) {
+ var options = opt_options || {};
cr.webUIListenerCallback('update-status-changed', {
- progress: opt_progress === undefined ? 1 : opt_progress,
+ progress: options.progress === undefined ? 1 : options.progress,
+ message: options.message,
status: status,
});
}
@@ -224,14 +229,14 @@ cr.define('settings_about_page', function() {
assertNotEquals(previousMessageText, statusMessageEl.textContent);
previousMessageText = statusMessageEl.textContent;
- fireStatusChanged(UpdateStatus.UPDATING, 0);
+ fireStatusChanged(UpdateStatus.UPDATING, {progress: 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);
+ fireStatusChanged(UpdateStatus.UPDATING, {progress: 1});
assertNotEquals(previousMessageText, statusMessageEl.textContent);
assertTrue(statusMessageEl.textContent.includes('%'));
previousMessageText = statusMessageEl.textContent;
@@ -258,6 +263,14 @@ cr.define('settings_about_page', function() {
assertEquals(0, statusMessageEl.textContent.trim().length);
});
+ test('ErrorMessageWithHtml', function() {
+ var htmlError = 'hello<br>there<br>was<pre>an</pre>error';
+ fireStatusChanged(
+ UpdateStatus.FAILED, {message: htmlError});
+ var statusMessageEl = page.$.updateStatusMessage;
+ assertEquals(htmlError, statusMessageEl.innerHTML);
+ });
+
/**
* Test that when the current platform has been marked as deprecated (but
* not end of the line) a deprecation warning message is displayed,
« no previous file with comments | « chrome/browser/resources/settings/about_page/about_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698