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

Issue 2861443003: MD Settings: Fix subpage visibility and add appearance page tests (Closed)

Created:
3 years, 7 months ago by stevenjb
Modified:
3 years, 7 months ago
Reviewers:
dpapad
CC:
arv+watch_chromium.org, chromium-reviews, dbeam+watch-settings_chromium.org, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, stevenjb+watch-md-settings_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

MD Settings: Fix subpage visibility and add appearance page tests BUG=717663 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Patch Set 1 #

Total comments: 8

Patch Set 2 : Fix default subpage visibility and CrSettingsMainPageTest #

Patch Set 3 : Revert to use hidden and improve tests #

Patch Set 4 : Rebase #

Total comments: 10

Patch Set 5 : Fix first-of-type selector #

Patch Set 6 : Remove cleanup #

Total comments: 2

Patch Set 7 : Restore showPage_ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -55 lines) Patch
M chrome/browser/resources/settings/appearance_page/appearance_page.html View 1 2 3 4 5 6 6 chunks +14 lines, -12 lines 0 comments Download
M chrome/browser/resources/settings/appearance_page/appearance_page.js View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/resources/settings/basic_page/basic_page.html View 1 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/resources/settings/basic_page/basic_page.js View 1 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/resources/settings/downloads_page/downloads_page.html View 1 2 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/settings/downloads_page/downloads_page.js View 1 2 3 6 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/resources/settings/privacy_page/privacy_page.html View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/resources/settings/privacy_page/privacy_page.js View 1 2 3 6 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/test/data/webui/settings/appearance_page_test.js View 1 2 3 4 5 6 5 chunks +41 lines, -4 lines 0 comments Download
M chrome/test/data/webui/settings/cr_settings_browsertest.js View 1 2 3 2 chunks +3 lines, -5 lines 0 comments Download
M chrome/test/data/webui/settings/settings_main_test.js View 1 2 3 7 chunks +97 lines, -26 lines 0 comments Download

Messages

Total messages: 32 (14 generated)
stevenjb
I forgot to include these changes in the first CL. There were some conflicts and ...
3 years, 7 months ago (2017-05-02 23:22:19 UTC) #3
dpapad
https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.html File chrome/browser/resources/settings/downloads_page/downloads_page.html (right): https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.html#newcode42 chrome/browser/resources/settings/downloads_page/downloads_page.html:42: <template is="dom-if" if="[[showPage_(pageVisibility.googleDrive)]]"> Is it necessary to switch a ...
3 years, 7 months ago (2017-05-02 23:32:00 UTC) #6
stevenjb
https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.html File chrome/browser/resources/settings/downloads_page/downloads_page.html (right): https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.html#newcode42 chrome/browser/resources/settings/downloads_page/downloads_page.html:42: <template is="dom-if" if="[[showPage_(pageVisibility.googleDrive)]]"> On 2017/05/02 23:32:00, dpapad wrote: > ...
3 years, 7 months ago (2017-05-02 23:36:03 UTC) #7
dpapad
https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.html File chrome/browser/resources/settings/downloads_page/downloads_page.html (right): https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.html#newcode42 chrome/browser/resources/settings/downloads_page/downloads_page.html:42: <template is="dom-if" if="[[showPage_(pageVisibility.googleDrive)]]"> On 2017/05/02 at 23:36:02, stevenjb wrote: ...
3 years, 7 months ago (2017-05-02 23:45:52 UTC) #8
stevenjb
https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.html File chrome/browser/resources/settings/downloads_page/downloads_page.html (right): https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.html#newcode42 chrome/browser/resources/settings/downloads_page/downloads_page.html:42: <template is="dom-if" if="[[showPage_(pageVisibility.googleDrive)]]"> On 2017/05/02 23:45:52, dpapad wrote: > ...
3 years, 7 months ago (2017-05-02 23:56:17 UTC) #9
dpapad
https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.js File chrome/browser/resources/settings/downloads_page/downloads_page.js (right): https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.js#newcode38 chrome/browser/resources/settings/downloads_page/downloads_page.js:38: value: function() { On 2017/05/02 at 23:56:17, stevenjb wrote: ...
3 years, 7 months ago (2017-05-03 00:18:49 UTC) #10
stevenjb
PTAL https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.js File chrome/browser/resources/settings/downloads_page/downloads_page.js (right): https://codereview.chromium.org/2861443003/diff/1/chrome/browser/resources/settings/downloads_page/downloads_page.js#newcode38 chrome/browser/resources/settings/downloads_page/downloads_page.js:38: value: function() { On 2017/05/03 00:18:48, dpapad wrote: ...
3 years, 7 months ago (2017-05-03 19:58:40 UTC) #13
stevenjb
PTAL. Diff from master should be reasonable now.
3 years, 7 months ago (2017-05-03 22:29:39 UTC) #18
dpapad
https://codereview.chromium.org/2861443003/diff/60001/chrome/browser/resources/settings/appearance_page/appearance_page.html File chrome/browser/resources/settings/appearance_page/appearance_page.html (left): https://codereview.chromium.org/2861443003/diff/60001/chrome/browser/resources/settings/appearance_page/appearance_page.html#oldcode154 chrome/browser/resources/settings/appearance_page/appearance_page.html:154: <div class$="settings-box [[getFirst_(pageVisibility.bookmarksBar)]]"> Isn't this addressing the problem of ...
3 years, 7 months ago (2017-05-03 23:02:25 UTC) #19
stevenjb
https://codereview.chromium.org/2861443003/diff/60001/chrome/browser/resources/settings/appearance_page/appearance_page.html File chrome/browser/resources/settings/appearance_page/appearance_page.html (left): https://codereview.chromium.org/2861443003/diff/60001/chrome/browser/resources/settings/appearance_page/appearance_page.html#oldcode154 chrome/browser/resources/settings/appearance_page/appearance_page.html:154: <div class$="settings-box [[getFirst_(pageVisibility.bookmarksBar)]]"> On 2017/05/03 23:02:24, dpapad wrote: > ...
3 years, 7 months ago (2017-05-03 23:31:43 UTC) #20
stevenjb
https://codereview.chromium.org/2861443003/diff/60001/chrome/browser/resources/settings/appearance_page/appearance_page.html File chrome/browser/resources/settings/appearance_page/appearance_page.html (right): https://codereview.chromium.org/2861443003/diff/60001/chrome/browser/resources/settings/appearance_page/appearance_page.html#newcode27 chrome/browser/resources/settings/appearance_page/appearance_page.html:27: settings-box:first-of-type { On 2017/05/03 23:31:43, stevenjb wrote: > On ...
3 years, 7 months ago (2017-05-03 23:33:16 UTC) #21
stevenjb
https://codereview.chromium.org/2861443003/diff/60001/chrome/browser/resources/settings/appearance_page/appearance_page.html File chrome/browser/resources/settings/appearance_page/appearance_page.html (right): https://codereview.chromium.org/2861443003/diff/60001/chrome/browser/resources/settings/appearance_page/appearance_page.html#newcode27 chrome/browser/resources/settings/appearance_page/appearance_page.html:27: settings-box:first-of-type { On 2017/05/03 23:33:16, stevenjb wrote: > On ...
3 years, 7 months ago (2017-05-03 23:36:52 UTC) #22
stevenjb
PTAL
3 years, 7 months ago (2017-05-04 00:14:57 UTC) #23
dpapad
https://codereview.chromium.org/2861443003/diff/100001/chrome/browser/resources/settings/basic_page/basic_page.js File chrome/browser/resources/settings/basic_page/basic_page.js (right): https://codereview.chromium.org/2861443003/diff/100001/chrome/browser/resources/settings/basic_page/basic_page.js#newcode150 chrome/browser/resources/settings/basic_page/basic_page.js:150: return /** @type {Object} */ (this.get(subpage, visibility)) || {}; ...
3 years, 7 months ago (2017-05-04 01:03:24 UTC) #24
stevenjb
On 2017/05/04 01:03:24, dpapad wrote: > https://codereview.chromium.org/2861443003/diff/100001/chrome/browser/resources/settings/basic_page/basic_page.js > File chrome/browser/resources/settings/basic_page/basic_page.js (right): > > https://codereview.chromium.org/2861443003/diff/100001/chrome/browser/resources/settings/basic_page/basic_page.js#newcode150 > ...
3 years, 7 months ago (2017-05-04 15:41:28 UTC) #25
stevenjb
PTAL & LMKWYT
3 years, 7 months ago (2017-05-04 15:43:14 UTC) #27
Dan Beam
On 2017/05/04 15:41:28, stevenjb wrote: > On 2017/05/04 01:03:24, dpapad wrote: > > > https://codereview.chromium.org/2861443003/diff/100001/chrome/browser/resources/settings/basic_page/basic_page.js ...
3 years, 7 months ago (2017-05-04 19:13:10 UTC) #31
Dan Beam
3 years, 7 months ago (2017-05-04 19:14:04 UTC) #32
On 2017/05/04 19:13:10, Dan Beam wrote:
> On 2017/05/04 15:41:28, stevenjb wrote:
> > On 2017/05/04 01:03:24, dpapad wrote:
> > >
> >
>
https://codereview.chromium.org/2861443003/diff/100001/chrome/browser/resourc...
> > > File chrome/browser/resources/settings/basic_page/basic_page.js (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/2861443003/diff/100001/chrome/browser/resourc...
> > > chrome/browser/resources/settings/basic_page/basic_page.js:150: return /**
> > @type
> > > {Object} */ (this.get(subpage, visibility)) || {};
> > > I tried the CL locally and I still see the sections hidden as in the bug
> > report.
> > > Played with it locally and it seems that this line needs to be as follows
> for
> > it
> > > to work:
> > > 
> > > return /** @type {Object} */ (this.get(subpage, visibility));
> > > 
> > > Essentially, now that we are using |hidden|, we should not be sending an
> empty
> > > object to the the other pages (like appearance), because bindings like
> > > hidden="[[!pageVisibility.homeButton]]"
> > > 
> > > evaluate to true, if pageVisibility is an empty object.
> > > 
> > > In retrospect, I think in the original CL we should
> > >  1) not have changed the default value of settings-ui's pageVisibility
> > >  2) have kept pageVisibility only used for "guestMode" and not bundle the
> > > "show-android-apps" functionality into it (which is the reason we changed
> the
> > > default value).
> > > 
> > > I hope this makes sense (just trying to help, given the complications that
> > were
> > > created by the original CL, which I should have been more thoroughly
> > > reviewing.).
> > > 
> > >
> >
>
https://codereview.chromium.org/2861443003/diff/100001/chrome/test/data/webui...
> > > File chrome/test/data/webui/settings/appearance_page_test.js (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/2861443003/diff/100001/chrome/test/data/webui...
> > > chrome/test/data/webui/settings/appearance_page_test.js:145:
> > > assertTrue(!!appearancePage.$$('#homeButton'));
> > > Now that we don't use dom-if, these tests are insufficient (they check
> > existence
> > > which is always true, and therefore did not catch the problem mentioned in
> > > previous comment).
> > 
> > Good grief, have I mentioned recently how much I despise Javascript?
> > 
> > I was in too much of a rush last night. I actually had tests for hidden but
> > didn't save/test that version, and clearly didn't manually test it.
> > 
> > I added back showPage_ which IMHO is the better approach when we are using
> > undefined == visible == truthy.
> > 
> > If you are unhappy with this approach I can revert my original "cleanup" CL
> and
> > we can let this code rot.
> 
> i'd be happy to revert the original CL that caused these breaks

ah, just saw this was already done here
https://codereview.chromium.org/2866463002/

Powered by Google App Engine
This is Rietveld 408576698