| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.define('settings_about_page', function() { | 5 cr.define('settings_about_page', function() { |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @implements {settings.AboutPageBrowserProxy} | 8 * @implements {settings.AboutPageBrowserProxy} |
| 9 * @extends {settings.TestBrowserProxy} | 9 * @extends {settings.TestBrowserProxy} |
| 10 */ | 10 */ |
| 11 var TestAboutPageBrowserProxy = function() { | 11 var TestAboutPageBrowserProxy = function() { |
| 12 settings.TestBrowserProxy.call(this, [ | 12 settings.TestBrowserProxy.call(this, [ |
| 13 'pageReady', |
| 13 'refreshUpdateStatus', | 14 'refreshUpdateStatus', |
| 14 'openHelpPage', | 15 'openHelpPage', |
| 15 'openFeedbackDialog', | 16 'openFeedbackDialog', |
| 16 'getCurrentChannel', | 17 'getCurrentChannel', |
| 17 'getVersionInfo', | 18 'getVersionInfo', |
| 18 ]); | 19 ]); |
| 19 | 20 |
| 20 /** @type {!VersionInfo} */ | 21 /** @type {!VersionInfo} */ |
| 21 this.versionInfo_ = { | 22 this.versionInfo_ = { |
| 22 arcVersion: '', | 23 arcVersion: '', |
| 23 osFirmware: '', | 24 osFirmware: '', |
| 24 osVersion: '', | 25 osVersion: '', |
| 25 }; | 26 }; |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 TestAboutPageBrowserProxy.prototype = { | 29 TestAboutPageBrowserProxy.prototype = { |
| 29 __proto__: settings.TestBrowserProxy.prototype, | 30 __proto__: settings.TestBrowserProxy.prototype, |
| 30 | 31 |
| 31 /** @param {!VersionInfo} */ | 32 /** @param {!VersionInfo} */ |
| 32 setVersionInfo: function(versionInfo) { | 33 setVersionInfo: function(versionInfo) { |
| 33 this.versionInfo_ = versionInfo; | 34 this.versionInfo_ = versionInfo; |
| 34 }, | 35 }, |
| 35 | 36 |
| 36 /** @override */ | 37 /** @override */ |
| 38 pageReady: function() { |
| 39 this.methodCalled('pageReady'); |
| 40 }, |
| 41 |
| 42 /** @override */ |
| 37 refreshUpdateStatus: function() { | 43 refreshUpdateStatus: function() { |
| 38 this.methodCalled('refreshUpdateStatus'); | 44 this.methodCalled('refreshUpdateStatus'); |
| 39 }, | 45 }, |
| 40 | 46 |
| 41 /** @override */ | 47 /** @override */ |
| 42 getCurrentChannel: function() { | 48 getCurrentChannel: function() { |
| 43 this.methodCalled('getCurrentChannel'); | 49 this.methodCalled('getCurrentChannel'); |
| 44 return Promise.resolve(BrowserChannel.BETA); | 50 return Promise.resolve(BrowserChannel.BETA); |
| 45 }, | 51 }, |
| 46 | 52 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 arcVersion: 'dummyArcVersion', | 128 arcVersion: 'dummyArcVersion', |
| 123 osFirmware: 'dummyOsFirmware', | 129 osFirmware: 'dummyOsFirmware', |
| 124 osVersion: 'dummyOsVersion', | 130 osVersion: 'dummyOsVersion', |
| 125 }; | 131 }; |
| 126 browserProxy.setVersionInfo(versionInfo); | 132 browserProxy.setVersionInfo(versionInfo); |
| 127 | 133 |
| 128 page = document.createElement('settings-detailed-build-info'); | 134 page = document.createElement('settings-detailed-build-info'); |
| 129 document.body.appendChild(page); | 135 document.body.appendChild(page); |
| 130 | 136 |
| 131 return Promise.all([ | 137 return Promise.all([ |
| 132 browserProxy.whenCalled('refreshUpdateStatus'), | 138 browserProxy.whenCalled('pageReady'), |
| 133 browserProxy.whenCalled('getVersionInfo'), | 139 browserProxy.whenCalled('getVersionInfo'), |
| 134 browserProxy.whenCalled('getCurrentChannel'), | 140 browserProxy.whenCalled('getCurrentChannel'), |
| 135 ]).then(function() { | 141 ]).then(function() { |
| 136 assertEquals(versionInfo.arcVersion, page.$.arcVersion.textContent); | 142 assertEquals(versionInfo.arcVersion, page.$.arcVersion.textContent); |
| 137 assertEquals(versionInfo.osVersion, page.$.osVersion.textContent); | 143 assertEquals(versionInfo.osVersion, page.$.osVersion.textContent); |
| 138 assertEquals(versionInfo.osFirmware, page.$.osFirmware.textContent); | 144 assertEquals(versionInfo.osFirmware, page.$.osFirmware.textContent); |
| 139 }); | 145 }); |
| 140 }); | 146 }); |
| 141 }); | 147 }); |
| 142 } | 148 } |
| 143 } | 149 } |
| 144 | 150 |
| 145 return { | 151 return { |
| 146 registerTests: function() { | 152 registerTests: function() { |
| 147 if (cr.isChromeOS) { | 153 if (cr.isChromeOS) { |
| 148 registerDetailedBuildInfoTests(); | 154 registerDetailedBuildInfoTests(); |
| 149 } | 155 } |
| 150 registerAboutPageTests(); | 156 registerAboutPageTests(); |
| 151 }, | 157 }, |
| 152 registerOfficialBuildTests: registerOfficialBuildTests, | 158 registerOfficialBuildTests: registerOfficialBuildTests, |
| 153 }; | 159 }; |
| 154 }); | 160 }); |
| OLD | NEW |