Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** @fileoverview Runs polymer appearance font settings elements. */ | |
|
dpapad
2016/04/13 19:06:24
Nit:
/** @fileoverview Tests for appearance font s
| |
| 6 | |
| 7 cr.define('settings_appearance', function() { | |
| 8 /** | |
| 9 * A test version of FontsBrowserProxy. | |
| 10 * | |
| 11 * @constructor | |
| 12 * @implements {settings.FontsBrowserProxy} | |
| 13 * @extends {settings.TestBrowserProxy} | |
| 14 */ | |
| 15 var TestFontsBrowserProxy = function() { | |
| 16 settings.TestBrowserProxy.call(this, [ | |
| 17 'fetchFontsData', | |
| 18 'observeAdvancedFontExtensionAvailable', | |
| 19 ]); | |
| 20 | |
| 21 /** @private {!FontsData} */ | |
| 22 this.fontsData_ = { | |
| 23 'fontList': [['font name', 'alternate', 'ltr']], | |
|
dpapad
2016/04/13 19:06:24
Nit(optional): Object property names do not need q
| |
| 24 'encodingList': [['encoding name', 'alternate', 'ltr']], | |
| 25 }; | |
| 26 }; | |
| 27 | |
| 28 TestFontsBrowserProxy.prototype = { | |
| 29 __proto__: settings.TestBrowserProxy.prototype, | |
| 30 | |
| 31 /** @override */ | |
| 32 fetchFontsData: function() { | |
| 33 this.methodCalled('fetchFontsData'); | |
| 34 return Promise.resolve(this.fontsData_); | |
| 35 }, | |
| 36 | |
| 37 /** @override */ | |
| 38 observeAdvancedFontExtensionAvailable: function() { | |
| 39 this.methodCalled('observeAdvancedFontExtensionAvailable'); | |
| 40 }, | |
| 41 }; | |
| 42 | |
| 43 function registerAppearanceFontSettingsBrowserTest() { | |
| 44 var fontsPage = null; | |
| 45 | |
| 46 /** @type {?TestFontsBrowserProxy} */ | |
| 47 var fontsBrowserProxy = null; | |
| 48 | |
| 49 suite('AppearanceFontHandler', function() { | |
| 50 setup(function() { | |
| 51 fontsBrowserProxy = new TestFontsBrowserProxy(); | |
| 52 settings.FontsBrowserProxyImpl.instance_ = fontsBrowserProxy; | |
| 53 | |
| 54 PolymerTest.clearBody(); | |
| 55 | |
| 56 fontsPage = document.createElement('settings-appearance-fonts-page'); | |
| 57 document.body.appendChild(fontsPage); | |
| 58 }); | |
| 59 | |
| 60 teardown(function() { fontsPage.remove(); }); | |
| 61 | |
| 62 test('fetchFontsData', function() { | |
| 63 return fontsBrowserProxy.whenCalled('fetchFontsData'); | |
| 64 }); | |
| 65 }); | |
| 66 } | |
| 67 | |
| 68 return { | |
| 69 registerTests: function() { | |
| 70 registerAppearanceFontSettingsBrowserTest(); | |
| 71 }, | |
| 72 }; | |
| 73 }); | |
| OLD | NEW |