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..ab7fc76080d84317fe7f969370236ff0e3d4a44e |
--- /dev/null |
+++ b/chrome/test/data/webui/settings/appearance_browsertest.js |
@@ -0,0 +1,47 @@ |
+// 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. */ |
+ |
+// Polymer BrowserTest fixture. |
stevenjb
2015/11/20 17:59:37
Michael pointed out this comment is no longer accu
dschuyler
2015/11/20 18:12:11
Done.
|
+GEN_INCLUDE(['settings_page_browsertest.js']); |
+ |
+/** |
+ * Test Polymer Appearance Settings elements. |
+ * @constructor |
+ * @extends {PolymerTest} |
stevenjb
2015/11/20 17:16:07
@extends {SettingsPageBrowserTest}
dschuyler
2015/11/20 18:12:10
Done.
|
+*/ |
+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() { |
+ var self = this; |
+ suite('AppearanceHandler', function() { |
+ test('font settings', function() { |
+ var fontSize = self.appearancePage( |
+ '#defaultFontSize').$$('[class=iron-selected]'); |
+ assertEquals('Medium', fontSize.textContent); |
stevenjb
2015/11/20 17:16:07
nit: Personally I would just assertTrue(!!fontSize
michaelpg
2015/11/20 17:23:41
Dumb question: how do we know the prefs have loade
stevenjb
2015/11/20 17:59:37
That's actually a good question. My guess is "they
dschuyler
2015/11/20 18:02:40
I'm thinking that the prefs in this test will be r
michaelpg
2015/11/20 18:07:44
We don't need a wrapper per se. In settings_page_b
dschuyler
2015/11/20 18:12:11
Cool. I'd like to think about explicitly setting
|
+ }); |
+ |
+ test('home button', function() { |
+ var homeButton = self.appearancePage('#showHomeButton'); |
+ assertEquals('false', homeButton.getAttribute('aria-pressed')); |
+ }); |
+ }); |
+ mocha.run(); |
+}); |