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

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

Issue 2754563002: MD Settings: Lazy load the contents of the "advanced" settings. (Closed)
Patch Set: Simplify, remove unnecessary file. Created 3 years, 9 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/settings_subpage_browsertest.js
diff --git a/chrome/test/data/webui/settings/settings_subpage_browsertest.js b/chrome/test/data/webui/settings/settings_subpage_browsertest.js
index 5e32e649e720d5a943e7c90fa4946d17ab0429a8..72f5ad71b1f9c3a702796e0743043f339d0f83da 100644
--- a/chrome/test/data/webui/settings/settings_subpage_browsertest.js
+++ b/chrome/test/data/webui/settings/settings_subpage_browsertest.js
@@ -12,14 +12,8 @@ GEN_INCLUDE(['settings_page_browsertest.js']);
/**
* @constructor
* @extends {SettingsPageBrowserTest}
- *
- * @param {string} pageId Just 'basic'. TODO(michaelpg): Add 'about' if we want
- * to, but that requires wrapping its sole <settings-section> in a dom-if.
*/
-function SettingsSubPageBrowserTest(pageId) {
- /** @type {string} */
- this.pageId = pageId;
-
+function SettingsSubPageBrowserTest() {
/** @type {!Array<string>} */
this.subPages = [];
}
@@ -36,18 +30,12 @@ SettingsSubPageBrowserTest.prototype = {
settingsHidePagesByDefaultForTest = true;
},
- /** @override */
- setUp: function() {
- SettingsPageBrowserTest.prototype.setUp.call(this);
- this.verifySubPagesHidden_();
- },
-
/*
* Checks all subpages are hidden first.
* @private
*/
verifySubPagesHidden_: function() {
- var page = this.getPage(this.pageId);
+ var page = this.page;
assertEquals(0, Object.keys(page.pageVisibility).length);
// Ensure all pages are still hidden after the dom-ifs compute their |if|.
@@ -79,9 +67,11 @@ SettingsSubPageBrowserTest.prototype = {
},
testSubPages: function() {
- var page = this.getPage(this.pageId);
this.subPages.forEach(function(subPage) {
- test(subPage, this.testSubPage.bind(this, page, subPage));
+ test(subPage, function() {
+ this.verifySubPagesHidden_();
+ this.testSubPage.bind(this, this.page, subPage);
Dan Beam 2017/03/16 20:52:22 this is not the same. did you mean this.testSubP
dpapad 2017/03/17 00:08:09 Good catch. Yes, I meant what you wrote above. I'l
+ }.bind(this));
}.bind(this));
},
};

Powered by Google App Engine
This is Rietveld 408576698