| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 GEN_INCLUDE(['options_browsertest_base.js']); | 5 GEN_INCLUDE(['options_browsertest_base.js']); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * TestFixture for font settings WebUI testing. | 8 * TestFixture for font settings WebUI testing. |
| 9 * @extends {testing.Test} | 9 * @extends {testing.Test} |
| 10 * @constructor | 10 * @constructor |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 ]; | 34 ]; |
| 35 | 35 |
| 36 // Enable when failure is resolved. | 36 // Enable when failure is resolved. |
| 37 // AX_TEXT_01: http://crbug.com/570555 | 37 // AX_TEXT_01: http://crbug.com/570555 |
| 38 this.accessibilityAuditConfig.ignoreSelectors( | 38 this.accessibilityAuditConfig.ignoreSelectors( |
| 39 'controlsWithoutLabel', | 39 'controlsWithoutLabel', |
| 40 controlsWithoutLabelSelectors); | 40 controlsWithoutLabelSelectors); |
| 41 }, | 41 }, |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // TODO(crbug.com/657514) Flakes on linux and chromeos. |
| 45 GEN('#if defined(OS_LINUX) || defined(OS_CHROMEOS)'); |
| 46 GEN('#define MAYBE_testOpenFontSettings DISABLED_testOpenFontSettings'); |
| 47 GEN('#else'); |
| 48 GEN('#define MAYBE_testOpenFontSettings testOpenFontSettings'); |
| 49 GEN('#endif // defined(OS_WIN)'); |
| 44 // Test opening font settings has correct location. | 50 // Test opening font settings has correct location. |
| 45 TEST_F('FontSettingsWebUITest', 'testOpenFontSettings', function() { | 51 TEST_F('FontSettingsWebUITest', 'MAYBE_testOpenFontSettings', function() { |
| 46 assertEquals(this.browsePreload, document.location.href); | 52 assertEquals(this.browsePreload, document.location.href); |
| 47 }); | 53 }); |
| 48 | 54 |
| 49 // Test setup of the Advanced Font Settings links. | 55 // Test setup of the Advanced Font Settings links. |
| 50 TEST_F('FontSettingsWebUITest', 'testAdvancedFontSettingsLink', function() { | 56 TEST_F('FontSettingsWebUITest', 'testAdvancedFontSettingsLink', function() { |
| 51 var installElement = $('advanced-font-settings-install'); | 57 var installElement = $('advanced-font-settings-install'); |
| 52 var optionsElement = $('advanced-font-settings-options'); | 58 var optionsElement = $('advanced-font-settings-options'); |
| 53 var expectedUrl = 'https://chrome.google.com/webstore/detail/' + | 59 var expectedUrl = 'https://chrome.google.com/webstore/detail/' + |
| 54 'caclkomlalccbpcdllchkeecicepbmbm'; | 60 'caclkomlalccbpcdllchkeecicepbmbm'; |
| 55 | 61 |
| 56 FontSettings.notifyAdvancedFontSettingsAvailability(false); | 62 FontSettings.notifyAdvancedFontSettingsAvailability(false); |
| 57 assertFalse(installElement.hidden); | 63 assertFalse(installElement.hidden); |
| 58 assertEquals(expectedUrl, installElement.querySelector('a').href); | 64 assertEquals(expectedUrl, installElement.querySelector('a').href); |
| 59 assertTrue(optionsElement.hidden); | 65 assertTrue(optionsElement.hidden); |
| 60 | 66 |
| 61 FontSettings.notifyAdvancedFontSettingsAvailability(true); | 67 FontSettings.notifyAdvancedFontSettingsAvailability(true); |
| 62 assertTrue(installElement.hidden); | 68 assertTrue(installElement.hidden); |
| 63 assertFalse(optionsElement.hidden); | 69 assertFalse(optionsElement.hidden); |
| 64 this.mockHandler.expects(once()).openAdvancedFontSettingsOptions(); | 70 this.mockHandler.expects(once()).openAdvancedFontSettingsOptions(); |
| 65 optionsElement.click(); | 71 optionsElement.click(); |
| 66 }); | 72 }); |
| OLD | NEW |