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

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: Address comments. 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
« no previous file with comments | « chrome/test/data/webui/settings/settings_passwords_section_browsertest.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bbc22ecfc5e49f603c91c6b276c05f2935a1bd5b 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.basicPage;
assertEquals(0, Object.keys(page.pageVisibility).length);
// Ensure all pages are still hidden after the dom-ifs compute their |if|.
@@ -79,9 +67,10 @@ 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.testSubPage(this.basicPage, subPage);
+ }.bind(this));
}.bind(this));
},
};
@@ -108,6 +97,7 @@ SettingsBasicSubPageBrowserTest.prototype = {
};
TEST_F('SettingsBasicSubPageBrowserTest', 'SubPages', function() {
+ suiteSetup(this.verifySubPagesHidden_.bind(this));
suite('Basic', this.testSubPages.bind(this));
mocha.run();
});
@@ -144,6 +134,7 @@ SettingsAdvancedSubPageBrowserTest.prototype = {
};
TEST_F('SettingsAdvancedSubPageBrowserTest', 'SubPages', function() {
+ suiteSetup(this.verifySubPagesHidden_.bind(this));
suite('Advanced', this.testSubPages.bind(this));
mocha.run();
});
« no previous file with comments | « chrome/test/data/webui/settings/settings_passwords_section_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698