1 // Copyright (c) 2012 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.
6 * TestFixture for font settings WebUI testing.
7 * @extends {testing.Test}
10 function FontSettingsWebUITest() {}
12 FontSettingsWebUITest.prototype = {
13 __proto__: testing.Test.prototype,
16 * Browse to the font settings page.
18 browsePreload: 'chrome://settings-frame/fonts',
22 this.makeAndRegisterMockHandler(['openAdvancedFontSettingsOptions']);
26 // Test opening font settings has correct location.
27 TEST_F('FontSettingsWebUITest', 'testOpenFontSettings', function() {
28 assertEquals(this.browsePreload, document.location.href);
31 // Test setup of the Advanced Font Settings links.
32 TEST_F('FontSettingsWebUITest', 'testAdvancedFontSettingsLink', function() {
33 var installElement = $('advanced-font-settings-install');
34 var optionsElement = $('advanced-font-settings-options');
35 var expectedUrl = 'https://chrome.google.com/webstore/detail/' +
36 'caclkomlalccbpcdllchkeecicepbmbm';
38 FontSettings.notifyAdvancedFontSettingsAvailability(false);
39 assertFalse(installElement.hidden);
40 assertEquals(expectedUrl, installElement.querySelector('a').href);
41 assertTrue(optionsElement.hidden);
43 FontSettings.notifyAdvancedFontSettingsAvailability(true);
44 assertTrue(installElement.hidden);
45 assertFalse(optionsElement.hidden);
46 this.mockHandler.expects(once()).openAdvancedFontSettingsOptions();
47 optionsElement.click();