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

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

Issue 2538043006: Settings: About: Fix cros channel info. (Closed)
Patch Set: . Created 4 years 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
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 6ffdaf98f6c5744c174da12356764229d291431d..74188b00a4772d87c5113aced1118a0b9b6f5db6 100644
--- a/chrome/test/data/webui/settings/about_page_tests.js
+++ b/chrome/test/data/webui/settings/about_page_tests.js
@@ -21,6 +21,7 @@ cr.define('settings_about_page', function() {
'getCurrentChannel',
'getTargetChannel',
'getVersionInfo',
+ 'getCanChangeChannel',
'getRegulatoryInfo',
'setChannel');
}
@@ -38,6 +39,9 @@ cr.define('settings_about_page', function() {
osVersion: '',
};
+ /** @type {boolean} */
dpapad 2016/12/05 18:52:27 @private
stevenjb 2016/12/06 20:38:03 Done.
+ this.canChangeChannel_ = true;
+
/** @private {!BrowserChannel} */
this.currentChannel_ = BrowserChannel.BETA;
@@ -88,6 +92,12 @@ cr.define('settings_about_page', function() {
this.versionInfo_ = versionInfo;
};
+ /** @param {boolean} */
+ TestAboutPageBrowserProxy.prototype.setCanChangeChannel = function(
+ canChangeChannel) {
+ this.canChangeChannel_ = canChangeChannel;
+ };
+
/**
* @param {!BrowserChannel} current
* @param {!BrowserChannel} target
@@ -124,6 +134,12 @@ cr.define('settings_about_page', function() {
};
/** @override */
+ TestAboutPageBrowserProxy.prototype.getCanChangeChannel = function() {
+ this.methodCalled('getCanChangeChannel');
+ return Promise.resolve(this.canChangeChannel_);
+ };
+
+ /** @override */
TestAboutPageBrowserProxy.prototype.getRegulatoryInfo = function() {
this.methodCalled('getRegulatoryInfo');
return Promise.resolve(this.regulatoryInfo_);
@@ -580,7 +596,7 @@ cr.define('settings_about_page', function() {
return Promise.all([
browserProxy.whenCalled('pageReady'),
browserProxy.whenCalled('getVersionInfo'),
- browserProxy.whenCalled('getCurrentChannel'),
+ browserProxy.whenCalled('getTargetChannel'),
]).then(function() {
assertEquals(versionInfo.arcVersion, page.$.arcVersion.textContent);
assertEquals(versionInfo.osVersion, page.$.osVersion.textContent);
@@ -596,23 +612,24 @@ cr.define('settings_about_page', function() {
* changing channels is allowed.
dpapad 2016/12/05 18:52:27 @return {!Promise} missing
*/
function checkChangeChannelButton(canChangeChannel) {
- loadTimeData.overrideValues({
- aboutCanChangeChannel: canChangeChannel
- });
+ browserProxy.setCanChangeChannel(canChangeChannel);
page = document.createElement('settings-detailed-build-info');
document.body.appendChild(page);
-
- var changeChannelButton = page.$$('paper-button');
- assertTrue(!!changeChannelButton);
- assertEquals(canChangeChannel, !changeChannelButton.disabled)
+ return Promise.all([
+ browserProxy.whenCalled('getCanChangeChannel'),
dpapad 2016/12/05 18:52:27 Why use Promise.all() for a single Promise?
stevenjb 2016/12/06 20:38:03 Done.
+ ]).then(function() {
+ var changeChannelButton = page.$$('paper-button');
+ assertTrue(!!changeChannelButton);
+ assertEquals(canChangeChannel, !changeChannelButton.disabled);
+ });
}
test('ChangeChannel_Enabled', function() {
- checkChangeChannelButton(true);
+ return checkChangeChannelButton(true);
});
test('ChangeChannel_Disabled', function() {
- checkChangeChannelButton(false);
+ return checkChangeChannelButton(false);
});
});
}
@@ -635,7 +652,7 @@ cr.define('settings_about_page', function() {
radioButtons = dialog.shadowRoot.querySelectorAll(
'paper-radio-button');
assertEquals(3, radioButtons.length);
- return browserProxy.whenCalled('getCurrentChannel');
+ return browserProxy.whenCalled('getTargetChannel');
});
teardown(function() { dialog.remove(); });

Powered by Google App Engine
This is Rietveld 408576698