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

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

Issue 2733963002: MD Settings: Debounce navigation event in side nav. (Closed)
Patch Set: fix test Created 3 years, 9 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
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 var openIcon = ironIconElement.icon; 54 var openIcon = ironIconElement.icon;
55 assertTrue(!!openIcon); 55 assertTrue(!!openIcon);
56 56
57 settingsMenu.advancedOpened = false; 57 settingsMenu.advancedOpened = false;
58 Polymer.dom.flush(); 58 Polymer.dom.flush();
59 assertNotEquals(openIcon, ironIconElement.icon); 59 assertNotEquals(openIcon, ironIconElement.icon);
60 }); 60 });
61 61
62 // Test that navigating via the paper menu always clears the current 62 // Test that navigating via the paper menu always clears the current
63 // search URL parameter. 63 // search URL parameter.
64 test('clearsUrlSearchParam', function() { 64 test('clearsUrlSearchParam', function(done) {
65 var urlParams = new URLSearchParams('search=foo'); 65 var urlParams = new URLSearchParams('search=foo');
66 settings.navigateTo(settings.Route.BASIC, urlParams); 66 settings.navigateTo(settings.Route.BASIC, urlParams);
67 assertEquals( 67 assertEquals(
68 urlParams.toString(), 68 urlParams.toString(),
69 settings.getQueryParameters().toString()); 69 settings.getQueryParameters().toString());
70 MockInteractions.tap(settingsMenu.$.people); 70 MockInteractions.tap(settingsMenu.$.people);
71 assertEquals('', settings.getQueryParameters().toString()); 71
72 window.setTimeout(function() {
73 assertEquals('', settings.getQueryParameters().toString());
74 done();
75 }, 0);
dschuyler 2017/03/15 01:13:02 nit: zero is the default msec value (so it's not n
hcarmona 2017/03/15 19:22:09 Done.
72 }); 76 });
73 }); 77 });
74 78
75 suite('SettingsMenuReset', function() { 79 suite('SettingsMenuReset', function() {
76 setup(function() { 80 setup(function() {
77 PolymerTest.clearBody(); 81 PolymerTest.clearBody();
78 settings.navigateTo(settings.Route.RESET, ''); 82 settings.navigateTo(settings.Route.RESET, '');
79 settingsMenu = document.createElement('settings-menu'); 83 settingsMenu = document.createElement('settings-menu');
80 document.body.appendChild(settingsMenu); 84 document.body.appendChild(settingsMenu);
81 }); 85 });
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 }); 117 });
114 }); 118 });
115 } 119 }
116 120
117 return { 121 return {
118 registerTests: function() { 122 registerTests: function() {
119 registerSettingsMenuTest(); 123 registerSettingsMenuTest();
120 }, 124 },
121 }; 125 };
122 }); 126 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698