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

Side by Side Diff: chrome/test/data/webui/settings/appearance_page_test.js

Issue 1864713003: [MD settings] appearance browser tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test proxy Created 4 years, 8 months 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 unified diff | Download patch
OLDNEW
(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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698