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

Side by Side Diff: chrome/test/data/webui/settings/basic_page_browsertest.js

Issue 2022893003: [MD settings] scroll to section find host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review changes 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/settings_page/main_page_behavior.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** @fileoverview Suite of tests for the Settings basic page. */ 5 /** @fileoverview Suite of tests for the Settings basic page. */
6 6
7 GEN_INCLUDE(['settings_page_browsertest.js']); 7 GEN_INCLUDE(['settings_page_browsertest.js']);
8 8
9 /** 9 /**
10 * @constructor 10 * @constructor
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 sections.push('defaultBrowser'); 44 sections.push('defaultBrowser');
45 else 45 else
46 sections = sections.concat(['internet', 'device']); 46 sections = sections.concat(['internet', 'device']);
47 47
48 for (var i = 0; i < sections.length; i++) { 48 for (var i = 0; i < sections.length; i++) {
49 var section = self.getSection(page, sections[i]); 49 var section = self.getSection(page, sections[i]);
50 expectTrue(!!section); 50 expectTrue(!!section);
51 self.verifySubpagesHidden(section); 51 self.verifySubpagesHidden(section);
52 } 52 }
53 }); 53 });
54
55 // This test checks for a regression that occurred with scrollToSection_
56 // failing to find its host element.
57 test('scroll to section', function() {
58 // Setting the page and section will cause a scrollToSection_.
59 self.getPage('basic').currentRoute = {
60 page: 'basic',
61 section: 'onStartup',
62 subpage: [],
63 };
64
65 return new Promise(function(resolve, reject) {
66 function pollForVisibility() {
67 var page = self.getPage('basic')
68 var section = self.getSection(page, page.currentRoute.section);
69 if (!section)
70 setTimeout(pollForVisibility, 55);
71 else
72 resolve();
73 }
74 pollForVisibility();
Dan Beam 2016/05/31 22:10:29 arguably: var intervalId = window.setInterval(fun
dschuyler 2016/05/31 22:25:02 Done.
75 }.bind(self));
76 });
54 }); 77 });
55 78
56 // Run all registered tests. 79 // Run all registered tests.
57 mocha.run(); 80 mocha.run();
58 }); 81 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/settings_page/main_page_behavior.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698