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

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

Issue 2011703002: MD Settings: About page, hooking up channel switcher dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@about_regulatory_info
Patch Set: Indentation nits, after merging. 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/about_page/detailed_build_info.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 9af8d3bb1847d5cca831eaa18d143288db1e3d0e..b186eac082386ea3cf1940ca69b96aa0f17b7604 100644
--- a/chrome/test/data/webui/settings/about_page_tests.js
+++ b/chrome/test/data/webui/settings/about_page_tests.js
@@ -289,6 +289,29 @@ cr.define('settings_about_page', function() {
});
});
+ /**
+ * Test that buttons update as a result of receiving a
+ * 'target-channel-changed' event (normally fired from
+ * <settings-channel-switcher-dialog>).
+ */
+ test('ButtonsUpdate_TargetChannelChangedEvent', function() {
+ browserProxy.setChannels(BrowserChannel.BETA, BrowserChannel.BETA);
+ browserProxy.setUpdateStatus(UpdateStatus.NEARLY_UPDATED);
+
+ return initNewPage().then(function() {
+ assertFalse(page.$.relaunch.hidden);
+ assertTrue(page.$.relaunchAndPowerwash.hidden);
+
+ page.fire('target-channel-changed', BrowserChannel.DEV);
+ assertFalse(page.$.relaunch.hidden);
+ assertTrue(page.$.relaunchAndPowerwash.hidden);
+
+ page.fire('target-channel-changed', BrowserChannel.STABLE);
+ assertTrue(page.$.relaunch.hidden);
+ assertFalse(page.$.relaunchAndPowerwash.hidden);
+ });
+ });
+
test('RegulatoryInfo', function() {
var regulatoryInfo = null;
@@ -326,8 +349,8 @@ cr.define('settings_about_page', function() {
if (!cr.isChromeOS) {
/*
- * Test that the "Check for updates" button updates according to
- * incoming 'update-status-changed' events.
+ * Test that the "Relaunch" button updates according to incoming
+ * 'update-status-changed' events.
*/
test('ButtonsUpdate', function() {
var relaunch = page.$.relaunch;
@@ -397,7 +420,10 @@ cr.define('settings_about_page', function() {
PolymerTest.clearBody();
});
- teardown(function() { page.remove(); });
+ teardown(function() {
+ page.remove();
+ page = null;
+ });
test('Initialization', function() {
var versionInfo = {
@@ -420,6 +446,33 @@ cr.define('settings_about_page', function() {
assertEquals(versionInfo.osFirmware, page.$.osFirmware.textContent);
});
});
+
+ /**
+ * Checks whether the "change channel" button state (enabled/disabled)
+ * correctly reflects whether the user is allowed to change channel (as
+ * dictated by the browser via loadTimeData boolean).
+ * @param {boolean} canChangeChannel Whether to simulate the case where
+ * changing channels is allowed.
+ */
+ function checkChangeChannelButton(canChangeChannel) {
+ loadTimeData.overrideValues({
+ aboutCanChangeChannel: canChangeChannel
+ });
+ page = document.createElement('settings-detailed-build-info');
+ document.body.appendChild(page);
+
+ var changeChannelButton = page.$$('paper-button');
+ assertTrue(!!changeChannelButton);
+ assertEquals(canChangeChannel, !changeChannelButton.disabled)
+ }
+
+ test('ChangeChannel_Enabled', function() {
+ checkChangeChannelButton(true);
+ });
+
+ test('ChangeChannel_Disabled', function() {
+ checkChangeChannelButton(false);
+ });
});
}
« no previous file with comments | « chrome/browser/resources/settings/about_page/detailed_build_info.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698