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 cr.define('md_history.history_routing_test', function() { | 5 cr.define('md_history.history_routing_test', function() { |
6 function registerTests() { | 6 function registerTests() { |
7 suite('routing-test', function() { | 7 suite('routing-test', function() { |
8 var app; | 8 var app; |
9 var list; | 9 var list; |
10 var toolbar; | 10 var toolbar; |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 test('route updates from sidebar', function() { | 27 test('route updates from sidebar', function() { |
28 var menu = sidebar.$.menu; | 28 var menu = sidebar.$.menu; |
29 assertEquals('', app.routeData_.page); | 29 assertEquals('', app.routeData_.page); |
30 assertEquals('chrome://history/', window.location.href); | 30 assertEquals('chrome://history/', window.location.href); |
31 | 31 |
32 MockInteractions.tap(menu.children[1]); | 32 MockInteractions.tap(menu.children[1]); |
33 assertEquals('syncedTabs', app.routeData_.page); | 33 assertEquals('syncedTabs', app.routeData_.page); |
34 assertEquals('chrome://history/syncedTabs', window.location.href); | 34 assertEquals('chrome://history/syncedTabs', window.location.href); |
35 | 35 |
36 MockInteractions.tap(menu.children[0]); | 36 MockInteractions.keyDownOn(menu.children[0], 32, '', "Space"); |
37 assertEquals('', app.routeData_.page); | 37 assertEquals('', app.routeData_.page); |
38 assertEquals('chrome://history/', window.location.href); | 38 assertEquals('chrome://history/', window.location.href); |
39 }); | 39 }); |
40 | 40 |
41 test('route updates from search', function() { | 41 test('route updates from search', function() { |
42 var searchTerm = 'McCree'; | 42 var searchTerm = 'McCree'; |
43 assertEquals('', app.routeData_.page); | 43 assertEquals('', app.routeData_.page); |
44 toolbar.setSearchTerm(searchTerm); | 44 toolbar.setSearchTerm(searchTerm); |
45 assertEquals(searchTerm, app.queryParams_.q); | 45 assertEquals(searchTerm, app.queryParams_.q); |
46 }); | 46 }); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 | 114 |
115 registerMessageCallback('queryHistory', this, verifyFunction); | 115 registerMessageCallback('queryHistory', this, verifyFunction); |
116 }); | 116 }); |
117 }); | 117 }); |
118 } | 118 } |
119 return { | 119 return { |
120 registerTests: registerTests | 120 registerTests: registerTests |
121 }; | 121 }; |
122 }); | 122 }); |
OLD | NEW |