Chromium Code Reviews| Index: chrome/test/data/webui/md_history/history_routing_test.js |
| diff --git a/chrome/test/data/webui/md_history/history_routing_test.js b/chrome/test/data/webui/md_history/history_routing_test.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e6cd0306989010faf05d1e089297c4296a4d1f32 |
| --- /dev/null |
| +++ b/chrome/test/data/webui/md_history/history_routing_test.js |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +cr.define('md_history.history_routing_test', function() { |
| + function registerTests() { |
| + suite('synced-tabs', function() { |
|
tsergeant
2016/07/15 03:56:14
Nit: Rename this suite.
calamity
2016/07/15 06:22:02
Done.
|
| + var app; |
| + var list; |
| + |
| + suiteSetup(function() { |
| + app = $('history-app'); |
| + sidebar = app.$['side-bar'] |
| + }); |
| + |
| + test('changing route changes active view', function() { |
| + assertEquals('history', app.$.content.selected); |
| + app.set('routeData_.page', 'syncedTabs'); |
| + return flush().then(function() { |
| + assertEquals('syncedTabs', app.$.content.selected); |
|
tsergeant
2016/07/15 03:56:14
Nit: Maybe assert that the URL is correct?
calamity
2016/07/15 06:22:02
Done.
|
| + }); |
| + }); |
| + |
| + test('route updates from sidebar', function() { |
| + var menu = sidebar.$.menu; |
| + assertEquals('', app.routeData_.page); |
| + |
| + MockInteractions.tap(menu.children[1]); |
| + assertEquals('syncedTabs', app.routeData_.page); |
| + |
| + MockInteractions.tap(menu.children[0]); |
| + assertEquals('', app.routeData_.page); |
| + }); |
| + |
| + teardown(function() { |
| + app.set('routeData_.page', ''); |
| + }); |
| + }); |
| + } |
| + return { |
| + registerTests: registerTests |
| + }; |
| +}); |