| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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', function() { | 5 cr.define('settings', function() { |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @implements {settings.LanguagesBrowserProxy} | 8 * @implements {settings.LanguagesBrowserProxy} |
| 9 * @extends {settings.TestBrowserProxy} | 9 * @extends {test.TestBrowserProxy} |
| 10 */ | 10 */ |
| 11 var TestLanguagesBrowserProxy = function() { | 11 var TestLanguagesBrowserProxy = function() { |
| 12 var methodNames = []; | 12 var methodNames = []; |
| 13 if (cr.isChromeOS || cr.isWindows) | 13 if (cr.isChromeOS || cr.isWindows) |
| 14 methodNames.push('getProspectiveUILanguage'); | 14 methodNames.push('getProspectiveUILanguage'); |
| 15 | 15 |
| 16 settings.TestBrowserProxy.call(this, methodNames); | 16 test.TestBrowserProxy.call(this, methodNames); |
| 17 | 17 |
| 18 /** @private {!LanguageSettingsPrivate} */ | 18 /** @private {!LanguageSettingsPrivate} */ |
| 19 this.languageSettingsPrivate_ = new settings.FakeLanguageSettingsPrivate(); | 19 this.languageSettingsPrivate_ = new settings.FakeLanguageSettingsPrivate(); |
| 20 | 20 |
| 21 /** @private {!InputMethodPrivate} */ | 21 /** @private {!InputMethodPrivate} */ |
| 22 this.inputMethodPrivate_ = new settings.FakeInputMethodPrivate(); | 22 this.inputMethodPrivate_ = new settings.FakeInputMethodPrivate(); |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 TestLanguagesBrowserProxy.prototype = { | 25 TestLanguagesBrowserProxy.prototype = { |
| 26 __proto__: settings.TestBrowserProxy.prototype, | 26 __proto__: test.TestBrowserProxy.prototype, |
| 27 | 27 |
| 28 /** @override */ | 28 /** @override */ |
| 29 getLanguageSettingsPrivate: function() { | 29 getLanguageSettingsPrivate: function() { |
| 30 return this.languageSettingsPrivate_; | 30 return this.languageSettingsPrivate_; |
| 31 }, | 31 }, |
| 32 | 32 |
| 33 /** @override */ | 33 /** @override */ |
| 34 getInputMethodPrivate: function() { | 34 getInputMethodPrivate: function() { |
| 35 return this.inputMethodPrivate_; | 35 return this.inputMethodPrivate_; |
| 36 }, | 36 }, |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 if (cr.isChromeOS || cr.isWindows) { | 39 if (cr.isChromeOS || cr.isWindows) { |
| 40 /** @override */ | 40 /** @override */ |
| 41 TestLanguagesBrowserProxy.prototype.getProspectiveUILanguage = | 41 TestLanguagesBrowserProxy.prototype.getProspectiveUILanguage = |
| 42 function() { | 42 function() { |
| 43 this.methodCalled('getProspectiveUILanguage'); | 43 this.methodCalled('getProspectiveUILanguage'); |
| 44 return Promise.resolve('en-US'); | 44 return Promise.resolve('en-US'); |
| 45 }; | 45 }; |
| 46 } | 46 } |
| 47 | 47 |
| 48 return { | 48 return { |
| 49 TestLanguagesBrowserProxy: TestLanguagesBrowserProxy, | 49 TestLanguagesBrowserProxy: TestLanguagesBrowserProxy, |
| 50 }; | 50 }; |
| 51 }); | 51 }); |
| OLD | NEW |