Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Unified Diff: chrome/test/data/webui/settings/navigation_tests.js

Issue 2039603002: MD Settings: Fix scroll to section (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test coverage Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698