| OLD | NEW |
| 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 Loading... |
| 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 }); |
| OLD | NEW |