Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(942)

Side by Side Diff: chrome/browser/ui/webui/options/settings_app_browsertest.js

Issue 2121303003: Remove the "Settings" packaged app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/options/options_ui.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * TestFixture for App Launcher's Settings App testing.
7 * @extends {testing.Test}
8 * @constructor
9 */
10 function SettingsAppWebUITest() {}
11
12 SettingsAppWebUITest.prototype = {
13 __proto__: testing.Test.prototype,
14
15 /**
16 * Browse to Settings App page, in a browser.
17 */
18 browsePreload: 'chrome://settings-frame/options_settings_app.html',
19 };
20
21 GEN('#if defined(ENABLE_SETTINGS_APP)');
22
23 // This test is flaky on Linux and Windows bots. See crbug.com/579666
24 GEN('#if defined(OS_LINUX) || defined(OS_WIN)');
25 GEN('#define MAYBE_testOpenSettingsApp DISABLED_testOpenSettingsApp');
26 GEN('#else');
27 GEN('#define MAYBE_testOpenSettingsApp testOpenSettingsApp');
28 GEN('#endif // defined(OS_LINUX) || defined(OS_WIN)');
29 // Test opening Settings App, and do some checks on section visibility.
30 TEST_F('SettingsAppWebUITest', 'MAYBE_testOpenSettingsApp', function() {
31 // Note there is no location bar in the Settings App.
32
33 // Some things are hidden via a parent, so make a helper function.
34 function isVisible(elementId) {
35 var elem = $(elementId);
36 return elem.offsetWidth > 0 || elem.offsetHeight > 0;
37 }
38 assertTrue(OptionsPage.isSettingsApp());
39 assertTrue(isVisible('sync-users-section'));
40 assertTrue(isVisible('sync-section'));
41
42 // Spot-check some regular settings items that should be hidden.
43 assertFalse(isVisible('change-home-page-section'));
44 assertFalse(isVisible('default-search-engine'));
45 assertFalse(isVisible('hotword-search'));
46 assertFalse(isVisible('privacy-section'));
47 assertFalse(isVisible('startup-section'));
48 });
49
50 // This test is flaky on Linux and Windows bot. See crbug.com/579666
51 GEN('#if defined(OS_LINUX) || defined(OS_WIN)');
52 GEN('#define MAYBE_testStrings DISABLED_testStrings');
53 GEN('#else');
54 GEN('#define MAYBE_testStrings testStrings');
55 GEN('#endif // defined(OS_LINUX) || defined(OS_WIN)');
56 // Check functionality of LoadTimeData.overrideValues(), which the Settings App
57 // uses. Do spot checks, so the test is not too fragile. Some of the content
58 // strings rely on waiting for sync sign-in status, or platform-specifics.
59 TEST_F('SettingsAppWebUITest', 'MAYBE_testStrings', function() {
60 // Ensure we check against the override values.
61 assertTrue(!!loadTimeData.getValue('settingsApp'));
62
63 // Check a product-specific label, to ensure it uses "App Launcher", and not
64 // Chrome / Chromium.
65 var languagesLabelElement =
66 document.querySelector('[i18n-content="languageSectionLabel"]');
67 assertNotEquals(-1, languagesLabelElement.innerHTML.indexOf('App Launcher'));
68 });
69
70 GEN('#endif // defined(ENABLE_SETTINGS_APP)');
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/options_ui.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698