Chromium Code Reviews| Index: chrome/test/data/webui/settings/navigation_tests.js |
| diff --git a/chrome/test/data/webui/settings/navigation_tests.js b/chrome/test/data/webui/settings/navigation_tests.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ec98155e45c28648df2aece5d689c1487000a517 |
| --- /dev/null |
| +++ b/chrome/test/data/webui/settings/navigation_tests.js |
| @@ -0,0 +1,40 @@ |
| +// 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('navigation_tests', function() { |
| + function registerTests(testFixture) { |
| + // Register mocha tests. |
| + // TODO(michaelpg): Moar tests (page navigation, scroll position, history). |
| + suite('Navigation', function() { |
| + var basicPage; |
| + var menu; |
| + |
| + suiteSetup(function() { |
| + basicPage = testFixture.getPage('basic'); |
| + menu = document.querySelector('* /deep/ settings-menu'); |
|
dschuyler
2016/06/06 21:57:48
Can we avoid this use of /deep/?
michaelpg
2016/06/06 22:16:48
there's still no consensus on the deprecation of /
|
| + }); |
| + |
| + test('scroll to section', function(done) { |
| + assertEquals(0, basicPage.scroller.scrollTop); |
| + |
| + var basicSubmenu = menu.$.basicPage; |
| + var searchMenuItem = basicSubmenu.querySelector( |
| + '.menu-content *[data-section=search]'); |
| + assertTrue(!!searchMenuItem); |
| + MockInteractions.tap(searchMenuItem); |
| + assertEquals('search', |
| + basicSubmenu.querySelector('paper-menu').selected); |
| + |
| + setTimeout(function() { |
| + assertLT(0, basicPage.scroller.scrollTop); |
|
dpapad
2016/06/03 22:59:50
I am guessing that this is necessary because the c
michaelpg
2016/06/03 23:31:57
not without messing with the prod code, which alre
|
| + done(); |
| + }); |
| + }); |
| + }); |
| + } |
| + |
| + return { |
| + registerTests: registerTests, |
| + }; |
| +}); |