| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 5 /** |
| 6 * TestFixture for App Launcher's Settings App testing. | 6 * TestFixture for App Launcher's Settings App testing. |
| 7 * @extends {testing.Test} | 7 * @extends {testing.Test} |
| 8 * @constructor | 8 * @constructor |
| 9 */ | 9 */ |
| 10 function SettingsAppWebUITest() {} | 10 function SettingsAppWebUITest() {} |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 var elem = $(elementId); | 29 var elem = $(elementId); |
| 30 return elem.offsetWidth > 0 || elem.offsetHeight > 0; | 30 return elem.offsetWidth > 0 || elem.offsetHeight > 0; |
| 31 } | 31 } |
| 32 assertTrue(OptionsPage.isSettingsApp()); | 32 assertTrue(OptionsPage.isSettingsApp()); |
| 33 assertTrue(isVisible('sync-users-section')); | 33 assertTrue(isVisible('sync-users-section')); |
| 34 assertTrue(isVisible('sync-section')); | 34 assertTrue(isVisible('sync-section')); |
| 35 | 35 |
| 36 // Spot-check some regular settings items that should be hidden. | 36 // Spot-check some regular settings items that should be hidden. |
| 37 assertFalse(isVisible('change-home-page-section')); | 37 assertFalse(isVisible('change-home-page-section')); |
| 38 assertFalse(isVisible('default-search-engine')); | 38 assertFalse(isVisible('default-search-engine')); |
| 39 assertFalse(isVisible('hotword-settings-section')); | 39 assertFalse(isVisible('hotword-search')); |
| 40 assertFalse(isVisible('privacy-section')); | 40 assertFalse(isVisible('privacy-section')); |
| 41 assertFalse(isVisible('startup-section')); | 41 assertFalse(isVisible('startup-section')); |
| 42 }); | 42 }); |
| 43 | 43 |
| 44 // Check functionality of LoadTimeData.overrideValues(), which the Settings App | 44 // Check functionality of LoadTimeData.overrideValues(), which the Settings App |
| 45 // uses. Do spot checks, so the test is not too fragile. Some of the content | 45 // uses. Do spot checks, so the test is not too fragile. Some of the content |
| 46 // strings rely on waiting for sync sign-in status, or platform-specifics. | 46 // strings rely on waiting for sync sign-in status, or platform-specifics. |
| 47 TEST_F('SettingsAppWebUITest', 'testStrings', function() { | 47 TEST_F('SettingsAppWebUITest', 'testStrings', function() { |
| 48 // Ensure we check against the override values. | 48 // Ensure we check against the override values. |
| 49 assertTrue(!!loadTimeData.getValue('settingsApp')); | 49 assertTrue(!!loadTimeData.getValue('settingsApp')); |
| 50 | 50 |
| 51 // Check a product-specific label, to ensure it uses "App Launcher", and not | 51 // Check a product-specific label, to ensure it uses "App Launcher", and not |
| 52 // Chrome / Chromium. | 52 // Chrome / Chromium. |
| 53 var languagesLabelElement = | 53 var languagesLabelElement = |
| 54 document.querySelector('[i18n-content="languageSectionLabel"]'); | 54 document.querySelector('[i18n-content="languageSectionLabel"]'); |
| 55 assertNotEquals(-1, languagesLabelElement.innerHTML.indexOf('App Launcher')); | 55 assertNotEquals(-1, languagesLabelElement.innerHTML.indexOf('App Launcher')); |
| 56 }); | 56 }); |
| 57 | 57 |
| 58 GEN('#endif // defined(ENABLE_SETTINGS_APP)'); | 58 GEN('#endif // defined(ENABLE_SETTINGS_APP)'); |
| OLD | NEW |