| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 GEN_INCLUDE(['options_browsertest_base.js']); | |
| 6 | |
| 7 /** | |
| 8 * TestFixture for font settings WebUI testing. | |
| 9 * @extends {testing.Test} | |
| 10 * @constructor | |
| 11 */ | |
| 12 function FontSettingsWebUITest() {} | |
| 13 | |
| 14 FontSettingsWebUITest.prototype = { | |
| 15 __proto__: OptionsBrowsertestBase.prototype, | |
| 16 | |
| 17 /** | |
| 18 * Browse to the font settings page. | |
| 19 */ | |
| 20 browsePreload: 'chrome://settings-frame/fonts', | |
| 21 | |
| 22 /** @override */ | |
| 23 preLoad: function() { | |
| 24 this.makeAndRegisterMockHandler(['openAdvancedFontSettingsOptions']); | |
| 25 }, | |
| 26 | |
| 27 /** @override */ | |
| 28 setUp: function() { | |
| 29 OptionsBrowsertestBase.prototype.setUp.call(this); | |
| 30 | |
| 31 var controlsWithoutLabelSelectors = [ | |
| 32 '#standard-font-size', | |
| 33 '#minimum-font-size', | |
| 34 ]; | |
| 35 | |
| 36 // Enable when failure is resolved. | |
| 37 // AX_TEXT_01: http://crbug.com/570555 | |
| 38 this.accessibilityAuditConfig.ignoreSelectors( | |
| 39 'controlsWithoutLabel', | |
| 40 controlsWithoutLabelSelectors); | |
| 41 }, | |
| 42 }; | |
| 43 | |
| 44 // Test opening font settings has correct location. | |
| 45 TEST_F('FontSettingsWebUITest', 'testOpenFontSettings', function() { | |
| 46 assertEquals(this.browsePreload, document.location.href); | |
| 47 }); | |
| 48 | |
| 49 // Test setup of the Advanced Font Settings links. | |
| 50 TEST_F('FontSettingsWebUITest', 'testAdvancedFontSettingsLink', function() { | |
| 51 var installElement = $('advanced-font-settings-install'); | |
| 52 var optionsElement = $('advanced-font-settings-options'); | |
| 53 var expectedUrl = 'https://chrome.google.com/webstore/detail/' + | |
| 54 'caclkomlalccbpcdllchkeecicepbmbm'; | |
| 55 | |
| 56 FontSettings.notifyAdvancedFontSettingsAvailability(false); | |
| 57 assertFalse(installElement.hidden); | |
| 58 assertEquals(expectedUrl, installElement.querySelector('a').href); | |
| 59 assertTrue(optionsElement.hidden); | |
| 60 | |
| 61 FontSettings.notifyAdvancedFontSettingsAvailability(true); | |
| 62 assertTrue(installElement.hidden); | |
| 63 assertFalse(optionsElement.hidden); | |
| 64 this.mockHandler.expects(once()).openAdvancedFontSettingsOptions(); | |
| 65 optionsElement.click(); | |
| 66 }); | |
| OLD | NEW |