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

Issue 2487423002: MD Settings: add tests for mischievous default zoom handling (Closed)

Created:
4 years, 1 month ago by Dan Beam
Modified:
4 years, 1 month 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/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MD Settings: add tests for mischievous default zoom handling BUG=663661 R=dpapad@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/8da6512026adab2c303f0cfd0ea5d58b94a4fb12 Cr-Commit-Position: refs/heads/master@{#431187}

Patch Set 1 #

Total comments: 8

Patch Set 2 : dpapad@ review #

Patch Set 3 : closure #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -25 lines) Patch
M chrome/browser/resources/settings/appearance_page/appearance_browser_proxy.js View 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/browser/resources/settings/appearance_page/appearance_page.js View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/resources/settings/appearance_page/compiled_resources2.gyp View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/data/webui/settings/appearance_page_test.js View 1 4 chunks +69 lines, -20 lines 0 comments Download

Messages

Total messages: 19 (11 generated)
Dan Beam
this depends on both: https://codereview.chromium.org/2489723006/ https://codereview.chromium.org/2488113002/ which rietveld can't currently handle (AFAIK). oh well. when ...
4 years, 1 month ago (2016-11-10 01:55:03 UTC) #3
dpapad
LGTM with nits. Thanks for adding tests! https://codereview.chromium.org/2487423002/diff/1/chrome/test/data/webui/settings/appearance_page_test.js File chrome/test/data/webui/settings/appearance_page_test.js (right): https://codereview.chromium.org/2487423002/diff/1/chrome/test/data/webui/settings/appearance_page_test.js#newcode25 chrome/test/data/webui/settings/appearance_page_test.js:25: defaultZoom_: 1, ...
4 years, 1 month ago (2016-11-10 02:38:34 UTC) #4
Dan Beam
https://codereview.chromium.org/2487423002/diff/1/chrome/test/data/webui/settings/appearance_page_test.js File chrome/test/data/webui/settings/appearance_page_test.js (right): https://codereview.chromium.org/2487423002/diff/1/chrome/test/data/webui/settings/appearance_page_test.js#newcode25 chrome/test/data/webui/settings/appearance_page_test.js:25: defaultZoom_: 1, On 2016/11/10 02:38:34, dpapad wrote: > Can ...
4 years, 1 month ago (2016-11-10 02:52:38 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2487423002/60001
4 years, 1 month ago (2016-11-10 04:27:44 UTC) #13
commit-bot: I haz the power
Committed patchset #3 (id:60001)
4 years, 1 month ago (2016-11-10 05:16:50 UTC) #15
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/8da6512026adab2c303f0cfd0ea5d58b94a4fb12 Cr-Commit-Position: refs/heads/master@{#431187}
4 years, 1 month ago (2016-11-10 05:19:38 UTC) #17
dpapad
https://codereview.chromium.org/2487423002/diff/1/chrome/test/data/webui/settings/appearance_page_test.js File chrome/test/data/webui/settings/appearance_page_test.js (right): https://codereview.chromium.org/2487423002/diff/1/chrome/test/data/webui/settings/appearance_page_test.js#newcode25 chrome/test/data/webui/settings/appearance_page_test.js:25: defaultZoom_: 1, On 2016/11/10 at 02:52:38, Dan Beam wrote: ...
4 years, 1 month ago (2016-11-10 17:57:46 UTC) #18
Dan Beam
4 years, 1 month ago (2016-11-10 18:54:36 UTC) #19
Message was sent while issue was closed.
https://codereview.chromium.org/2487423002/diff/1/chrome/test/data/webui/sett...
File chrome/test/data/webui/settings/appearance_page_test.js (right):

https://codereview.chromium.org/2487423002/diff/1/chrome/test/data/webui/sett...
chrome/test/data/webui/settings/appearance_page_test.js:25: defaultZoom_: 1,
On 2016/11/10 17:57:46, dpapad wrote:
> On 2016/11/10 at 02:52:38, Dan Beam wrote:
> > On 2016/11/10 02:38:34, dpapad wrote:
> > > Can me move this within the constructor instead? I know this also works
> because
> > > we only have one TestAppearanceBrowserProxy at a time, but generally
> speaking
> > > data members make more sense in the constructor.
> > 
> > Done, but is this request based on a style rule or statistically motivated
> precedent?
> 
> Both.
>
https://google.github.io/styleguide/javascriptguide.xml?showone=Method_and_pr...

interesting that the style guide calls this out explicitly.  i would say their
rationale doesn't actually apply in this case (neither method we're considering
changes shape) and is super implementation specific / has changed over the
years.

the most interesting bit, in my opinion, is how this actually works when you do:

  function Class() {}
  Class.prototype = {foo: 1};

  var c = new Class();  // c.foo == 1
  c.foo = 3;  // c.foo == 3

is actually fairly dirty, as if you do something like:

  // I'm done with |foo|, let's remove it!
  delete c.foo;  // delete returns true, c.foo == 1

as it's actually assigning a property on the instance, closer on the __proto__
chain.

tl;dr - I'm fine to do this.* = initialization in the ctor, but the statistics
question was a bit loaded: I know there's tons of webui that relies on
statically initializing prototype POD members :(.  I don't really want to change
all the existing code, but i'll keep it in mind.

thanks for the info!

Powered by Google App Engine
This is Rietveld 408576698