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

Unified Diff: chrome/test/data/webui/settings/appearance_browsertest.js

Issue 1862213002: Roll third_party/polymer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding carbon-route 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/settings/appearance_browsertest.js
diff --git a/chrome/test/data/webui/settings/appearance_browsertest.js b/chrome/test/data/webui/settings/appearance_browsertest.js
new file mode 100644
index 0000000000000000000000000000000000000000..6e3a8d7deaddad1b450630c307cd2ab84193c5a9
--- /dev/null
+++ b/chrome/test/data/webui/settings/appearance_browsertest.js
@@ -0,0 +1,74 @@
+// Copyright 2015 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.
+
+/** @fileoverview Runs Polymer Appearance Settings elements. */
+
+GEN_INCLUDE(['settings_page_browsertest.js']);
+
+/**
+ * Test Polymer Appearance Settings elements.
+ * @constructor
+ * @extends {SettingsPageBrowserTest}
+*/
+function AppearanceSettingsBrowserTest() {}
+
+AppearanceSettingsBrowserTest.prototype = {
+ __proto__: SettingsPageBrowserTest.prototype,
+
+ /** @return {string} */
+ appearancePage: function(selector) {
+ var section = this.getSection(this.getPage('basic'), 'appearance');
+ assertTrue(!!section);
+ var appearance = section.querySelector('settings-appearance-page');
+ assertTrue(!!appearance);
+ var result = appearance.$$(selector);
+ assertTrue(!!result);
+ return result;
+ },
+};
+
+TEST_F('AppearanceSettingsBrowserTest', 'uiTests', function() {
+ /**
+ * The prefs API that will get a fake implementation.
+ * @type {!SettingsPrivate}
+ */
+ var settingsPrefs;
+ var self = this;
+
+ var fontSize = function() {
+ return self.appearancePage(
+ '#defaultFontSize').$$('.iron-selected').textContent.trim();
+ };
+
+ suite('AppearanceHandler', function() {
+ suiteSetup(function() {
+ settingsPrefs = document.querySelector(
+ 'cr-settings').$$('settings-prefs');
+ assertTrue(!!settingsPrefs);
+ return CrSettingsPrefs.initialized;
+ });
+
+ test('very small font', function() {
+ settingsPrefs.set('prefs.webkit.webprefs.default_font_size.value', 9);
+ assertEquals('Very small', fontSize());
+ });
+
+ test('large font', function() {
+ settingsPrefs.set('prefs.webkit.webprefs.default_font_size.value', 20);
+ assertEquals('Large', fontSize());
+ });
+
+ /**
+ * If the font size is not one of the preset options (e.g. 16, 20, etc.)
+ * then the menu label will be 'Custom' (rather than 'Medium', 'Large',
+ * etc.).
+ */
+ test('custom font size', function() {
+ settingsPrefs.set(
+ 'prefs.webkit.webprefs.default_font_size.value', 19);
+ assertEquals('Custom', fontSize());
+ });
+ });
+ mocha.run();
+});

Powered by Google App Engine
This is Rietveld 408576698