OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 cr.define('md_history.history_routing_test', function() { |
| 6 function registerTests() { |
| 7 suite('synced-tabs', function() { |
| 8 var app; |
| 9 var list; |
| 10 |
| 11 suiteSetup(function() { |
| 12 app = $('history-app'); |
| 13 element = app.$['history-list']; |
| 14 sidebar = app.$['history-side-bar'] |
| 15 }); |
| 16 |
| 17 test('changing route changes active view', function() { |
| 18 assertEquals('history-list', app.selectedPage); |
| 19 app.set('route.path', '/openTabs'); |
| 20 return flush().then(function() { |
| 21 assertEquals('history-synced-device-manager', app.selectedPage); |
| 22 }); |
| 23 }); |
| 24 |
| 25 test('route updates from sidebar', function() { |
| 26 var menu = sidebar.$.menu; |
| 27 assertEquals('/', app.route.path); |
| 28 MockInteractions.tap(menu.children[1]); |
| 29 |
| 30 return flush().then(function() { |
| 31 assertEquals('/openTabs', app.route.path); |
| 32 MockInteractions.tap(menu.children[0]); |
| 33 return flush(); |
| 34 }).then(function() { |
| 35 assertEquals('/', app.route.path); |
| 36 }); |
| 37 }); |
| 38 |
| 39 teardown(function() { |
| 40 app.set('route.path', '/'); |
| 41 }); |
| 42 }); |
| 43 } |
| 44 return { |
| 45 registerTests: registerTests |
| 46 }; |
| 47 }); |
OLD | NEW |