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('privacy-section')); | 40 assertFalse(isVisible('privacy-section')); |
40 assertFalse(isVisible('startup-section')); | 41 assertFalse(isVisible('startup-section')); |
41 }); | 42 }); |
42 | 43 |
43 // Check functionality of LoadTimeData.overrideValues(), which the Settings App | 44 // Check functionality of LoadTimeData.overrideValues(), which the Settings App |
44 // 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 |
45 // 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. |
46 TEST_F('SettingsAppWebUITest', 'testStrings', function() { | 47 TEST_F('SettingsAppWebUITest', 'testStrings', function() { |
47 // Ensure we check against the override values. | 48 // Ensure we check against the override values. |
48 assertTrue(!!loadTimeData.getValue('settingsApp')); | 49 assertTrue(!!loadTimeData.getValue('settingsApp')); |
49 | 50 |
50 // 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 |
51 // Chrome / Chromium. | 52 // Chrome / Chromium. |
52 var languagesLabelElement = | 53 var languagesLabelElement = |
53 document.querySelector('[i18n-content="languageSectionLabel"]'); | 54 document.querySelector('[i18n-content="languageSectionLabel"]'); |
54 assertNotEquals(-1, languagesLabelElement.innerHTML.indexOf('App Launcher')); | 55 assertNotEquals(-1, languagesLabelElement.innerHTML.indexOf('App Launcher')); |
55 }); | 56 }); |
56 | 57 |
57 GEN('#endif // defined(ENABLE_SETTINGS_APP)'); | 58 GEN('#endif // defined(ENABLE_SETTINGS_APP)'); |
OLD | NEW |