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

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

Issue 2489723006: MD Settings: split appearance browser tests (Closed)
Patch Set: fonts page Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/appearance_page_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * @constructor
7 * @implements {settings.FontsBrowserProxy}
8 * @extends {settings.TestBrowserProxy}
9 */
10 var TestFontsBrowserProxy = function() {
11 settings.TestBrowserProxy.call(this, [
12 'fetchFontsData',
13 'observeAdvancedFontExtensionAvailable',
14 'openAdvancedFontSettings',
15 ]);
16
17 /** @private {!FontsData} */
18 this.fontsData_ = {
19 'fontList': [['font name', 'alternate', 'ltr']],
20 'encodingList': [['encoding name', 'alternate', 'ltr']],
21 };
22 };
23
24 TestFontsBrowserProxy.prototype = {
25 __proto__: settings.TestBrowserProxy.prototype,
26
27 /** @override */
28 fetchFontsData: function() {
29 this.methodCalled('fetchFontsData');
30 return Promise.resolve(this.fontsData_);
31 },
32
33 /** @override */
34 observeAdvancedFontExtensionAvailable: function() {
35 this.methodCalled('observeAdvancedFontExtensionAvailable');
36 },
37
38 /** @override */
39 openAdvancedFontSettings: function() {
40 this.methodCalled('openAdvancedFontSettings');
41 },
42 };
43
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 test('openAdvancedFontSettings', function() {
67 cr.webUIListenerCallback('advanced-font-settings-installed', [true]);
68 Polymer.dom.flush();
69 var button = fontsPage.$$('#advancedButton');
70 assert(!!button);
71 MockInteractions.tap(button);
72 return fontsBrowserProxy.whenCalled('openAdvancedFontSettings');
73 });
74 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/appearance_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698