| Index: chrome/test/data/webui/settings/appearance_fonts_page_test.js
|
| diff --git a/chrome/test/data/webui/settings/appearance_fonts_page_test.js b/chrome/test/data/webui/settings/appearance_fonts_page_test.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..84f90d53218c8b0ba82577f4307bdcb0f1a9fa41
|
| --- /dev/null
|
| +++ b/chrome/test/data/webui/settings/appearance_fonts_page_test.js
|
| @@ -0,0 +1,74 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +/**
|
| + * @constructor
|
| + * @implements {settings.FontsBrowserProxy}
|
| + * @extends {settings.TestBrowserProxy}
|
| + */
|
| +var TestFontsBrowserProxy = function() {
|
| + settings.TestBrowserProxy.call(this, [
|
| + 'fetchFontsData',
|
| + 'observeAdvancedFontExtensionAvailable',
|
| + 'openAdvancedFontSettings',
|
| + ]);
|
| +
|
| + /** @private {!FontsData} */
|
| + this.fontsData_ = {
|
| + 'fontList': [['font name', 'alternate', 'ltr']],
|
| + 'encodingList': [['encoding name', 'alternate', 'ltr']],
|
| + };
|
| +};
|
| +
|
| +TestFontsBrowserProxy.prototype = {
|
| + __proto__: settings.TestBrowserProxy.prototype,
|
| +
|
| + /** @override */
|
| + fetchFontsData: function() {
|
| + this.methodCalled('fetchFontsData');
|
| + return Promise.resolve(this.fontsData_);
|
| + },
|
| +
|
| + /** @override */
|
| + observeAdvancedFontExtensionAvailable: function() {
|
| + this.methodCalled('observeAdvancedFontExtensionAvailable');
|
| + },
|
| +
|
| + /** @override */
|
| + openAdvancedFontSettings: function() {
|
| + this.methodCalled('openAdvancedFontSettings');
|
| + },
|
| +};
|
| +
|
| +var fontsPage = null;
|
| +
|
| +/** @type {?TestFontsBrowserProxy} */
|
| +var fontsBrowserProxy = null;
|
| +
|
| +suite('AppearanceFontHandler', function() {
|
| + setup(function() {
|
| + fontsBrowserProxy = new TestFontsBrowserProxy();
|
| + settings.FontsBrowserProxyImpl.instance_ = fontsBrowserProxy;
|
| +
|
| + PolymerTest.clearBody();
|
| +
|
| + fontsPage = document.createElement('settings-appearance-fonts-page');
|
| + document.body.appendChild(fontsPage);
|
| + });
|
| +
|
| + teardown(function() { fontsPage.remove(); });
|
| +
|
| + test('fetchFontsData', function() {
|
| + return fontsBrowserProxy.whenCalled('fetchFontsData');
|
| + });
|
| +
|
| + test('openAdvancedFontSettings', function() {
|
| + cr.webUIListenerCallback('advanced-font-settings-installed', [true]);
|
| + Polymer.dom.flush();
|
| + var button = fontsPage.$$('#advancedButton');
|
| + assert(!!button);
|
| + MockInteractions.tap(button);
|
| + return fontsBrowserProxy.whenCalled('openAdvancedFontSettings');
|
| + });
|
| +});
|
|
|