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

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

Issue 2708993003: Fix issue where side nav wasn't updated every time the route changed. (Closed)
Patch Set: add tests Created 3 years, 10 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 Runs tests for the settings menu. */ 5 /** @fileoverview Runs tests for the settings menu. */
6 6
7 cr.define('settings_menu', function() { 7 cr.define('settings_menu', function() {
8 function registerSettingsMenuTest() { 8 function registerSettingsMenuTest() {
9 var settingsMenu = null; 9 var settingsMenu = null;
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 document.body.appendChild(settingsMenu); 80 document.body.appendChild(settingsMenu);
81 }); 81 });
82 82
83 teardown(function() { settingsMenu.remove(); }); 83 teardown(function() { settingsMenu.remove(); });
84 84
85 test('openResetSection', function() { 85 test('openResetSection', function() {
86 var selector = settingsMenu.$.subMenu; 86 var selector = settingsMenu.$.subMenu;
87 var path = new window.URL(selector.selected).pathname; 87 var path = new window.URL(selector.selected).pathname;
88 assertEquals('/reset', path); 88 assertEquals('/reset', path);
89 }); 89 });
90
91 test('navigateToAnotherSection', function() {
92 var selector = settingsMenu.$.subMenu;
93 var path = new window.URL(selector.selected).pathname;
94 assertEquals('/reset', path);
95
96 settings.navigateTo(settings.Route.PEOPLE, '');
97 Polymer.dom.flush();
98
99 path = new window.URL(selector.selected).pathname;
100 assertEquals('/people', path);
101 });
102
103 test('navigateToBasic', function() {
104 var selector = settingsMenu.$.subMenu;
105 var path = new window.URL(selector.selected).pathname;
106 assertEquals('/reset', path);
107
108 settings.navigateTo(settings.Route.BASIC, '');
109 Polymer.dom.flush();
110
111 // BASIC has no sub page selected.
112 assertFalse(!!selector.selected);
113 });
90 }); 114 });
91 } 115 }
92 116
93 return { 117 return {
94 registerTests: function() { 118 registerTests: function() {
95 registerSettingsMenuTest(); 119 registerSettingsMenuTest();
96 }, 120 },
97 }; 121 };
98 }); 122 });
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