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

Issue 1447103002: MD Settings: FakeSettingsPrivate for tests (Closed)

Created:
5 years, 1 month ago by michaelpg
Modified:
5 years ago
Reviewers:
stevenjb, Dan Beam
CC:
chromium-reviews, michaelpg+watch-md-settings_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, arv+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MD Settings: FakeSettingsPrivate for tests Move MockSettingsApi to its own file and rename it. Provide initializeForTesting method on <settings-prefs> instead of doing hacky stuff on window. BUG=425627 Committed: https://crrev.com/4001b0cc67123ac7a8f7afe3f50b5ebe4c012dc8 Cr-Commit-Position: refs/heads/master@{#361032}

Patch Set 1 #

Total comments: 2

Patch Set 2 : mock -> fake #

Total comments: 12

Patch Set 3 : ; #

Patch Set 4 : Change how fake is set #

Total comments: 4

Patch Set 5 : assertNotReached #

Total comments: 8

Patch Set 6 : proto -> interface #

Unified diffs Side-by-side diffs Delta from patch set Stats (+378 lines, -225 lines) Patch
M chrome/browser/resources/settings/prefs/compiled_resources.gyp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/resources/settings/prefs/prefs.js View 1 2 3 4 chunks +32 lines, -8 lines 0 comments Download
M chrome/browser/resources/settings/prefs/prefs_types.js View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/browser/resources/settings/settings_private_interface.js View 1 2 3 4 5 1 chunk +61 lines, -0 lines 0 comments Download
M chrome/test/data/webui/settings/cr_settings_browsertest.js View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/webui/settings/fake_settings_private.js View 1 2 3 1 chunk +145 lines, -0 lines 0 comments Download
M chrome/test/data/webui/settings/prefs_test_cases.js View 1 2 chunks +75 lines, -52 lines 0 comments Download
M chrome/test/data/webui/settings/prefs_tests.js View 1 2 3 7 chunks +56 lines, -165 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 35 (11 generated)
michaelpg
Is this better than what we have, and a decent pattern to follow for any ...
5 years, 1 month ago (2015-11-16 18:34:57 UTC) #4
stevenjb
Generally speaking I like this better than what we currently have. https://codereview.chromium.org/1447103002/diff/1/chrome/test/data/webui/settings/mock_settings_private.js File chrome/test/data/webui/settings/mock_settings_private.js (right): ...
5 years, 1 month ago (2015-11-16 18:51:13 UTC) #5
michaelpg
Renamed Mock to Fake. https://codereview.chromium.org/1447103002/diff/1/chrome/test/data/webui/settings/mock_settings_private.js File chrome/test/data/webui/settings/mock_settings_private.js (right): https://codereview.chromium.org/1447103002/diff/1/chrome/test/data/webui/settings/mock_settings_private.js#newcode31 chrome/test/data/webui/settings/mock_settings_private.js:31: for (var testCase of prefsTestCases) ...
5 years, 1 month ago (2015-11-17 01:07:40 UTC) #8
stevenjb
lgtm https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js File chrome/test/data/webui/settings/fake_settings_private.js (right): https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js#newcode13 chrome/test/data/webui/settings/fake_settings_private.js:13: return JSON.parse(JSON.stringify(obj)); Any reason we can't use Object.assign ...
5 years, 1 month ago (2015-11-17 18:24:19 UTC) #9
michaelpg
https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js File chrome/test/data/webui/settings/fake_settings_private.js (right): https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js#newcode13 chrome/test/data/webui/settings/fake_settings_private.js:13: return JSON.parse(JSON.stringify(obj)); On 2015/11/17 18:24:19, stevenjb wrote: > Any ...
5 years, 1 month ago (2015-11-17 22:02:11 UTC) #10
stevenjb
https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js File chrome/test/data/webui/settings/fake_settings_private.js (right): https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js#newcode13 chrome/test/data/webui/settings/fake_settings_private.js:13: return JSON.parse(JSON.stringify(obj)); On 2015/11/17 22:02:11, michaelpg wrote: > On ...
5 years, 1 month ago (2015-11-17 22:03:55 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1447103002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1447103002/40001
5 years, 1 month ago (2015-11-17 22:05:11 UTC) #13
Dan Beam
https://codereview.chromium.org/1447103002/diff/40001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1447103002/diff/40001/chrome/browser/resources/settings/prefs/prefs.js#newcode276 chrome/browser/resources/settings/prefs/prefs.js:276: chrome.settingsPrivate.onPrefsChanged.addListener( why are you [able to] undo this? https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js ...
5 years, 1 month ago (2015-11-17 23:01:15 UTC) #14
Dan Beam
https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js File chrome/test/data/webui/settings/fake_settings_private.js (right): https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js#newcode94 chrome/test/data/webui/settings/fake_settings_private.js:94: chrome.settingsPrivate = this; why is this better?
5 years, 1 month ago (2015-11-17 23:02:07 UTC) #16
michaelpg
https://codereview.chromium.org/1447103002/diff/40001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1447103002/diff/40001/chrome/browser/resources/settings/prefs/prefs.js#newcode276 chrome/browser/resources/settings/prefs/prefs.js:276: chrome.settingsPrivate.onPrefsChanged.addListener( On 2015/11/17 23:01:15, Dan Beam wrote: > why ...
5 years, 1 month ago (2015-11-17 23:51:51 UTC) #17
Dan Beam
https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js File chrome/test/data/webui/settings/fake_settings_private.js (right): https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js#newcode94 chrome/test/data/webui/settings/fake_settings_private.js:94: chrome.settingsPrivate = this; On 2015/11/17 23:51:51, michaelpg wrote: > ...
5 years, 1 month ago (2015-11-18 02:01:01 UTC) #18
michaelpg
https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js File chrome/test/data/webui/settings/fake_settings_private.js (right): https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js#newcode94 chrome/test/data/webui/settings/fake_settings_private.js:94: chrome.settingsPrivate = this; On 2015/11/18 02:01:01, Dan Beam wrote: ...
5 years, 1 month ago (2015-11-18 02:03:44 UTC) #19
Dan Beam
https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js File chrome/test/data/webui/settings/fake_settings_private.js (right): https://codereview.chromium.org/1447103002/diff/40001/chrome/test/data/webui/settings/fake_settings_private.js#newcode94 chrome/test/data/webui/settings/fake_settings_private.js:94: chrome.settingsPrivate = this; On 2015/11/18 02:03:44, michaelpg wrote: > ...
5 years, 1 month ago (2015-11-18 02:26:34 UTC) #20
michaelpg
For some reason, this CL (before and after this patch) adds 500ms to the test, ...
5 years, 1 month ago (2015-11-20 00:45:25 UTC) #23
michaelpg
https://codereview.chromium.org/1447103002/diff/120001/chrome/browser/resources/settings/settings_private_proto.js File chrome/browser/resources/settings/settings_private_proto.js (right): https://codereview.chromium.org/1447103002/diff/120001/chrome/browser/resources/settings/settings_private_proto.js#newcode23 chrome/browser/resources/settings/settings_private_proto.js:23: setPref: assertNotReached, this is weird, why is closure OK ...
5 years, 1 month ago (2015-11-20 00:51:06 UTC) #24
Dan Beam
https://codereview.chromium.org/1447103002/diff/120001/chrome/browser/resources/settings/settings_private_proto.js File chrome/browser/resources/settings/settings_private_proto.js (right): https://codereview.chromium.org/1447103002/diff/120001/chrome/browser/resources/settings/settings_private_proto.js#newcode23 chrome/browser/resources/settings/settings_private_proto.js:23: setPref: assertNotReached, On 2015/11/20 00:51:06, michaelpg wrote: > this ...
5 years, 1 month ago (2015-11-20 01:58:17 UTC) #25
Dan Beam
On 2015/11/20 00:45:25, michaelpg wrote: > For some reason, this CL (before and after this ...
5 years, 1 month ago (2015-11-20 02:16:07 UTC) #26
Dan Beam
i think this CL is a good step in the right direction (though larger than ...
5 years, 1 month ago (2015-11-20 02:18:20 UTC) #27
stevenjb
I'm still a little fuzzy on what the SettingsPrivate prototype does for us, but I ...
5 years, 1 month ago (2015-11-20 18:12:44 UTC) #28
michaelpg
https://codereview.chromium.org/1447103002/diff/120001/chrome/browser/resources/settings/settings_private_proto.js File chrome/browser/resources/settings/settings_private_proto.js (right): https://codereview.chromium.org/1447103002/diff/120001/chrome/browser/resources/settings/settings_private_proto.js#newcode7 chrome/browser/resources/settings/settings_private_proto.js:7: assertNotReached('Proto file should not be executed.'); On 2015/11/20 02:16:06, ...
5 years, 1 month ago (2015-11-21 23:03:50 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1447103002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1447103002/140001
5 years, 1 month ago (2015-11-21 23:04:13 UTC) #32
commit-bot: I haz the power
Committed patchset #6 (id:140001)
5 years, 1 month ago (2015-11-22 04:52:36 UTC) #33
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/4001b0cc67123ac7a8f7afe3f50b5ebe4c012dc8 Cr-Commit-Position: refs/heads/master@{#361032}
5 years, 1 month ago (2015-11-22 04:53:18 UTC) #34
Dan Beam
5 years ago (2015-11-23 18:56:09 UTC) #35
Message was sent while issue was closed.
https://codereview.chromium.org/1447103002/diff/120001/chrome/browser/resourc...
File chrome/browser/resources/settings/settings_private_proto.js (right):

https://codereview.chromium.org/1447103002/diff/120001/chrome/browser/resourc...
chrome/browser/resources/settings/settings_private_proto.js:7:
assertNotReached('Proto file should not be executed.');
On 2015/11/21 23:03:50, michaelpg wrote:
> On 2015/11/20 02:16:06, Dan Beam wrote:
> > what is a proto file?
> 
> renamed to interface.

you should probably keep the file name and class name the same

Powered by Google App Engine
This is Rietveld 408576698