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

Issue 1310843010: Add Polymer tests for cr-settings-prefs (Closed)

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

Description

Add Polymer tests for cr-settings-prefs This lays the groundwork for testing our prefs element and includes some basic tests. The test includes a mock of settingsPrivate. It would be good to come up with a better solution for making cr-settings-prefs use the mock; right now I have it working with a global variable which is less than ideal. After this CL, I'll add sanity tests for list and dictionary prefs. These CLs shouldn't *block* adding list & dict prefs, but I don't want to commit new features in prefs.js without at least having tests locally. So I may as well upload the tests for review as well. BUG=532270 TESTS=CrSettingsBrowserTest Committed: https://crrev.com/7091d052bfdec82bb28176dd072c10eafd24f7b3 Cr-Commit-Position: refs/heads/master@{#349268}

Patch Set 1 : #

Total comments: 3

Patch Set 2 : preempt stevenjb comments :) #

Total comments: 40

Patch Set 3 : already reviewed #

Total comments: 10

Patch Set 4 : extract test cases and simplify code #

Patch Set 5 : new changes #

Total comments: 11

Patch Set 6 : new changes 2 #

Patch Set 7 #

Patch Set 8 : feedback #

Patch Set 9 : moar pretty #

Total comments: 4

Patch Set 10 : clarify test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+342 lines, -13 lines) Patch
M chrome/browser/resources/settings/prefs/prefs.js View 1 2 3 4 5 6 7 8 9 3 chunks +11 lines, -5 lines 0 comments Download
M chrome/browser/resources/settings/prefs/prefs_types.js View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
A + chrome/test/data/webui/settings/cr_settings_browsertest.js View 1 2 3 2 chunks +14 lines, -8 lines 0 comments Download
A chrome/test/data/webui/settings/prefs_test_cases.js View 1 2 3 4 5 6 7 1 chunk +38 lines, -0 lines 0 comments Download
A chrome/test/data/webui/settings/prefs_tests.js View 1 2 3 4 5 6 7 8 9 1 chunk +277 lines, -0 lines 2 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 31 (7 generated)
michaelpg
Take a look at your leisure. https://codereview.chromium.org/1310843010/diff/20001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1310843010/diff/20001/chrome/browser/resources/settings/prefs/prefs.js#newcode110 chrome/browser/resources/settings/prefs/prefs.js:110: settingsApi_: chrome.settingsPrivate, is ...
5 years, 3 months ago (2015-09-05 07:11:59 UTC) #3
michaelpg
I've uploaded a CL which follows up by adding support for lists of nested dictionaries, ...
5 years, 3 months ago (2015-09-07 18:18:37 UTC) #4
michaelpg
https://codereview.chromium.org/1310843010/diff/20001/chrome/test/data/webui/polymer_browser_test_base.js File chrome/test/data/webui/polymer_browser_test_base.js (right): https://codereview.chromium.org/1310843010/diff/20001/chrome/test/data/webui/polymer_browser_test_base.js#newcode117 chrome/test/data/webui/polymer_browser_test_base.js:117: return PolymerTest.async(fn); this doesn't quite work. what I actually ...
5 years, 3 months ago (2015-09-08 06:26:59 UTC) #5
michaelpg
Some updates. To clarify, *this* CL is ready for review. https://codereview.chromium.org/1310843010/diff/20001/chrome/test/data/webui/polymer_browser_test_base.js File chrome/test/data/webui/polymer_browser_test_base.js (right): https://codereview.chromium.org/1310843010/diff/20001/chrome/test/data/webui/polymer_browser_test_base.js#newcode117 ...
5 years, 3 months ago (2015-09-11 20:14:38 UTC) #6
stevenjb
https://codereview.chromium.org/1310843010/diff/40001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1310843010/diff/40001/chrome/browser/resources/settings/prefs/prefs.js#newcode136 chrome/browser/resources/settings/prefs/prefs.js:136: if (!key) Should this normally happen? If not, maybe ...
5 years, 3 months ago (2015-09-11 21:03:47 UTC) #7
Dan Beam
https://codereview.chromium.org/1310843010/diff/40001/chrome/test/data/webui/polymer_browser_test_base.js File chrome/test/data/webui/polymer_browser_test_base.js (right): https://codereview.chromium.org/1310843010/diff/40001/chrome/test/data/webui/polymer_browser_test_base.js#newcode104 chrome/test/data/webui/polymer_browser_test_base.js:104: PolymerTest.async = function(fn) { initialize lastPromise_ to Promise.resolve(), remove ...
5 years, 3 months ago (2015-09-11 21:49:13 UTC) #8
michaelpg
https://codereview.chromium.org/1310843010/diff/40001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1310843010/diff/40001/chrome/browser/resources/settings/prefs/prefs.js#newcode136 chrome/browser/resources/settings/prefs/prefs.js:136: if (!key) On 2015/09/11 21:03:47, stevenjb wrote: > Should ...
5 years, 3 months ago (2015-09-13 03:01:07 UTC) #9
stevenjb
lgtm, but wait for Dan of course (who most certainly follows this all better than ...
5 years, 3 months ago (2015-09-14 23:18:19 UTC) #10
Dan Beam
lgtm https://codereview.chromium.org/1310843010/diff/60001/chrome/test/data/webui/polymer_browser_test_base.js File chrome/test/data/webui/polymer_browser_test_base.js (right): https://codereview.chromium.org/1310843010/diff/60001/chrome/test/data/webui/polymer_browser_test_base.js#newcode118 chrome/test/data/webui/polymer_browser_test_base.js:118: /** @type {Promise} */ nit: @type -> @private ...
5 years, 3 months ago (2015-09-14 23:31:48 UTC) #11
michaelpg
Thanks for the l-g-t-ms. If you don't mind a quick re-review, I've made some changes ...
5 years, 3 months ago (2015-09-15 01:17:58 UTC) #13
Dan Beam
https://codereview.chromium.org/1310843010/diff/60001/chrome/test/data/webui/settings/cr_settings_browsertest.js File chrome/test/data/webui/settings/cr_settings_browsertest.js (right): https://codereview.chromium.org/1310843010/diff/60001/chrome/test/data/webui/settings/cr_settings_browsertest.js#newcode27 chrome/test/data/webui/settings/cr_settings_browsertest.js:27: commandLineSwitches: [{switchName: 'enable-md-settings'}], On 2015/09/15 01:17:57, michaelpg wrote: > ...
5 years, 3 months ago (2015-09-15 01:37:18 UTC) #14
michaelpg
https://codereview.chromium.org/1310843010/diff/120001/chrome/test/data/webui/settings/prefs_test_cases.js File chrome/test/data/webui/settings/prefs_test_cases.js (right): https://codereview.chromium.org/1310843010/diff/120001/chrome/test/data/webui/settings/prefs_test_cases.js#newcode6 chrome/test/data/webui/settings/prefs_test_cases.js:6: * @type {Array<Object>} On 2015/09/15 01:37:18, Dan Beam wrote: ...
5 years, 3 months ago (2015-09-15 02:20:54 UTC) #16
stevenjb
still lgtm
5 years, 3 months ago (2015-09-16 00:27:11 UTC) #17
Dan Beam
https://codereview.chromium.org/1310843010/diff/120001/chrome/test/data/webui/settings/prefs_tests.js File chrome/test/data/webui/settings/prefs_tests.js (right): https://codereview.chromium.org/1310843010/diff/120001/chrome/test/data/webui/settings/prefs_tests.js#newcode243 chrome/test/data/webui/settings/prefs_tests.js:243: PolymerTest.async(function() { On 2015/09/15 02:20:53, michaelpg wrote: > On ...
5 years, 3 months ago (2015-09-16 00:54:19 UTC) #18
michaelpg
https://codereview.chromium.org/1310843010/diff/120001/chrome/test/data/webui/settings/prefs_tests.js File chrome/test/data/webui/settings/prefs_tests.js (right): https://codereview.chromium.org/1310843010/diff/120001/chrome/test/data/webui/settings/prefs_tests.js#newcode243 chrome/test/data/webui/settings/prefs_tests.js:243: PolymerTest.async(function() { On 2015/09/16 00:54:19, Dan Beam wrote: > ...
5 years, 3 months ago (2015-09-16 01:14:09 UTC) #19
Dan Beam
https://codereview.chromium.org/1310843010/diff/120001/chrome/test/data/webui/settings/prefs_tests.js File chrome/test/data/webui/settings/prefs_tests.js (right): https://codereview.chromium.org/1310843010/diff/120001/chrome/test/data/webui/settings/prefs_tests.js#newcode243 chrome/test/data/webui/settings/prefs_tests.js:243: PolymerTest.async(function() { On 2015/09/16 01:14:09, michaelpg wrote: > On ...
5 years, 3 months ago (2015-09-16 01:37:00 UTC) #20
michaelpg
it turns out the changes to prefs.js weren't too big, and the test becomes much ...
5 years, 3 months ago (2015-09-16 04:57:44 UTC) #22
Dan Beam
lgtm https://codereview.chromium.org/1310843010/diff/240001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1310843010/diff/240001/chrome/browser/resources/settings/prefs/prefs.js#newcode135 chrome/browser/resources/settings/prefs/prefs.js:135: return; can't you just use: if (!this.$) return; ...
5 years, 3 months ago (2015-09-16 05:53:56 UTC) #23
michaelpg
https://codereview.chromium.org/1310843010/diff/240001/chrome/browser/resources/settings/prefs/prefs.js File chrome/browser/resources/settings/prefs/prefs.js (right): https://codereview.chromium.org/1310843010/diff/240001/chrome/browser/resources/settings/prefs/prefs.js#newcode135 chrome/browser/resources/settings/prefs/prefs.js:135: return; On 2015/09/16 05:53:56, Dan Beam wrote: > can't ...
5 years, 3 months ago (2015-09-16 18:27:17 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1310843010/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1310843010/260001
5 years, 3 months ago (2015-09-16 21:15:51 UTC) #27
Dan Beam
still lgtm but question https://codereview.chromium.org/1310843010/diff/260001/chrome/test/data/webui/settings/prefs_tests.js File chrome/test/data/webui/settings/prefs_tests.js (right): https://codereview.chromium.org/1310843010/diff/260001/chrome/test/data/webui/settings/prefs_tests.js#newcode267 chrome/test/data/webui/settings/prefs_tests.js:267: // Send the same set ...
5 years, 3 months ago (2015-09-16 21:43:19 UTC) #28
michaelpg
https://codereview.chromium.org/1310843010/diff/260001/chrome/test/data/webui/settings/prefs_tests.js File chrome/test/data/webui/settings/prefs_tests.js (right): https://codereview.chromium.org/1310843010/diff/260001/chrome/test/data/webui/settings/prefs_tests.js#newcode267 chrome/test/data/webui/settings/prefs_tests.js:267: // Send the same set of changes again -- ...
5 years, 3 months ago (2015-09-16 21:46:30 UTC) #29
commit-bot: I haz the power
Committed patchset #10 (id:260001)
5 years, 3 months ago (2015-09-16 23:09:01 UTC) #30
commit-bot: I haz the power
5 years, 3 months ago (2015-09-16 23:09:48 UTC) #31
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/7091d052bfdec82bb28176dd072c10eafd24f7b3
Cr-Commit-Position: refs/heads/master@{#349268}

Powered by Google App Engine
This is Rietveld 408576698