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

Side by Side Diff: chrome/test/data/webui/settings/settings_ui_browsertest.js

Issue 2427743003: MD Settings: fix double-tap to hide advanced bug (Closed)
Patch Set: nit Created 4 years, 2 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/resources/settings/settings_menu/settings_menu.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** @fileoverview Suite of tests for the Settings layout. */ 5 /** @fileoverview Suite of tests for the Settings layout. */
6 6
7 GEN_INCLUDE(['settings_page_browsertest.js']); 7 GEN_INCLUDE(['settings_page_browsertest.js']);
8 8
9 /** 9 /**
10 * @constructor 10 * @constructor
(...skipping 14 matching lines...) Expand all
25 GEN('#define MAYBE_All All'); 25 GEN('#define MAYBE_All All');
26 GEN('#endif'); 26 GEN('#endif');
27 27
28 TEST_F('SettingsUIBrowserTest', 'MAYBE_All', function() { 28 TEST_F('SettingsUIBrowserTest', 'MAYBE_All', function() {
29 suite('settings-ui', function() { 29 suite('settings-ui', function() {
30 var toolbar; 30 var toolbar;
31 var ui; 31 var ui;
32 32
33 suiteSetup(function() { 33 suiteSetup(function() {
34 ui = assert(document.querySelector('settings-ui')); 34 ui = assert(document.querySelector('settings-ui'));
35 ui.$.drawerTemplate.restamp = true;
36 });
37
38 setup(function() {
39 ui.$.drawerTemplate.if = false;
40 Polymer.dom.flush();
35 }); 41 });
36 42
37 test('basic', function() { 43 test('basic', function() {
38 toolbar = assert(ui.$$('cr-toolbar')); 44 toolbar = assert(ui.$$('cr-toolbar'));
39 assertTrue(toolbar.showMenu); 45 assertTrue(toolbar.showMenu);
40 }); 46 });
41 47
42 test('app drawer', function(done) { 48 test('app drawer', function(done) {
43 assertEquals(null, ui.$$('settings-menu')); 49 assertEquals(null, ui.$$('settings-menu'));
44 var drawer = assert(ui.$$('app-drawer')); 50 var drawer = assert(ui.$$('app-drawer'));
(...skipping 22 matching lines...) Expand all
67 // Click away from the drawer. 73 // Click away from the drawer.
68 MockInteractions.tap(drawer.$.scrim); 74 MockInteractions.tap(drawer.$.scrim);
69 Polymer.Base.async(function() { 75 Polymer.Base.async(function() {
70 // Drawer is closed, but menu is still stamped so its contents remain 76 // Drawer is closed, but menu is still stamped so its contents remain
71 // visible as the drawer slides out. 77 // visible as the drawer slides out.
72 assertFalse(drawer.opened); 78 assertFalse(drawer.opened);
73 assertTrue(!!ui.$$('settings-menu')); 79 assertTrue(!!ui.$$('settings-menu'));
74 done(); 80 done();
75 }); 81 });
76 }); 82 });
83
84 test('advanced UIs stay in sync', function() {
85 var main = ui.$$('settings-main');
86 assertTrue(!!main);
87
88 assertFalse(!!ui.$$('settings-menu'));
89 assertFalse(ui.advancedOpened_);
90 assertFalse(main.advancedToggleExpanded);
91
92 main.advancedToggleExpanded = true;
93 Polymer.dom.flush();
94
95 assertFalse(!!ui.$$('settings-menu'));
96 assertTrue(ui.advancedOpened_);
97 assertTrue(main.advancedToggleExpanded);
98
99 ui.$.drawerTemplate.if = true;
100 Polymer.dom.flush();
101
102 var menu = ui.$$('settings-menu');
103 assertTrue(!!menu);
104 assertTrue(menu.advancedOpened);
105
106 MockInteractions.tap(menu.$$('#advancedPage .menu-trigger'));
107 Polymer.dom.flush();
108
109 // Check that all values are updated in unison.
110 assertFalse(menu.advancedOpened);
111 assertFalse(ui.advancedOpened_);
112 assertFalse(main.advancedToggleExpanded);
113 });
77 }); 114 });
78 115
79 mocha.run(); 116 mocha.run();
80 }); 117 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/settings_menu/settings_menu.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698