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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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');
+ });
+});
« 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