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

Issue 2834583002: Change ScopedFeatureList to overrides FeatureList not reset (Closed)

Created:
3 years, 8 months ago by chaopeng
Modified:
3 years, 5 months ago
CC:
chromium-reviews, danakj+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Change ScopedFeatureList to overrides FeatureList not reset The current situation is that using ScopedFeatureList resets to an empty feature list and then enables/disables an explicit list of features. That's never what you want for browser tests (or other higher-level tests) since it effectively overrides higher-level test configurations (e.g. those in fieldtrial_testing_config.json, or a bot set up to specifically test a feature). In this patch: 1. Keep SFL::Init, SFL::InitWithFeatureList, SFL::InitFromCommandLine reset to empty list but add warning to remind developer should use them with care. 2. Change SFL::InitAndEnableFeature, SFL::InitAndDisableFeature and SFL::InitWithFeatures to not reset but override current FeatureList with given enables/disables. We also add unit tests for ScopedFeatureList. BUG=713390 Review-Url: https://codereview.chromium.org/2834583002 Cr-Commit-Position: refs/heads/master@{#468210} Committed: https://chromium.googlesource.com/chromium/src/+/9c04ed553bd7abe820a6a93c5e8981e6738881a9

Patch Set 1 #

Total comments: 36

Patch Set 2 : addressed some comments from Ilya #

Total comments: 21

Patch Set 3 : Ilya comments addressed #

Total comments: 9

Patch Set 4 : Alexei and Ilya comments addressed #

Total comments: 10

Patch Set 5 : Ilya comments addressed #

Patch Set 6 : Alexei comment addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+306 lines, -25 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M base/test/scoped_feature_list.h View 1 2 1 chunk +24 lines, -11 lines 0 comments Download
M base/test/scoped_feature_list.cc View 1 2 3 4 5 3 chunks +93 lines, -14 lines 0 comments Download
A base/test/scoped_feature_list_unittest.cc View 1 2 3 4 1 chunk +188 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 44 (21 generated)
chaopeng
Hi Ilya, it seems OK to change all to InitWithFeatureListAndOverrides. WDYT?
3 years, 8 months ago (2017-04-20 14:56:30 UTC) #7
Ilya Sherman
+Alexei as an optional reviewer (FYI) Thanks, Jianpeng. https://codereview.chromium.org/2834583002/diff/1/base/test/scoped_feature_list.cc File base/test/scoped_feature_list.cc (right): https://codereview.chromium.org/2834583002/diff/1/base/test/scoped_feature_list.cc#newcode48 base/test/scoped_feature_list.cc:48: const ...
3 years, 8 months ago (2017-04-20 20:53:08 UTC) #9
chaopeng
Updated, PTAL. Thank you. https://codereview.chromium.org/2834583002/diff/1/base/test/scoped_feature_list.cc File base/test/scoped_feature_list.cc (right): https://codereview.chromium.org/2834583002/diff/1/base/test/scoped_feature_list.cc#newcode48 base/test/scoped_feature_list.cc:48: const std::initializer_list<base::Feature>& disabled_features) { On ...
3 years, 8 months ago (2017-04-21 02:36:22 UTC) #11
Ilya Sherman
Thanks! https://codereview.chromium.org/2834583002/diff/40001/base/test/scoped_feature_list.cc File base/test/scoped_feature_list.cc (right): https://codereview.chromium.org/2834583002/diff/40001/base/test/scoped_feature_list.cc#newcode19 base/test/scoped_feature_list.cc:19: static std::vector<std::string> GetFeatureString( nit: s/String/Vector https://codereview.chromium.org/2834583002/diff/40001/base/test/scoped_feature_list.cc#newcode19 base/test/scoped_feature_list.cc:19: static ...
3 years, 8 months ago (2017-04-21 22:43:35 UTC) #12
chaopeng
Updated, PTAL. Thank you. https://codereview.chromium.org/2834583002/diff/60001/base/test/scoped_feature_list.cc File base/test/scoped_feature_list.cc (right): https://codereview.chromium.org/2834583002/diff/60001/base/test/scoped_feature_list.cc#newcode54 base/test/scoped_feature_list.cc:54: Features* merged_features) { Is this ...
3 years, 8 months ago (2017-04-22 03:18:15 UTC) #13
Alexei Svitkine (slow)
Thanks for working on this. Please expand CL description to explain this change more and ...
3 years, 8 months ago (2017-04-24 15:55:11 UTC) #14
Ilya Sherman
Thanks! Just a few nits left to address =) https://codereview.chromium.org/2834583002/diff/60001/base/test/scoped_feature_list.cc File base/test/scoped_feature_list.cc (right): https://codereview.chromium.org/2834583002/diff/60001/base/test/scoped_feature_list.cc#newcode29 base/test/scoped_feature_list.cc:29: ...
3 years, 8 months ago (2017-04-24 19:49:51 UTC) #15
chaopeng
Updated. PTAL. Thank you. https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc File base/test/scoped_feature_list.cc (right): https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc#newcode123 base/test/scoped_feature_list.cc:123: std::string disables; Re Alexei: I ...
3 years, 8 months ago (2017-04-25 21:21:07 UTC) #19
Ilya Sherman
Thanks! LG % some nits, plus Alexei's request to use a StringPiece vector. https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc File ...
3 years, 8 months ago (2017-04-25 21:41:58 UTC) #20
chaopeng
Updated, PTAL. https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc File base/test/scoped_feature_list.cc (right): https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc#newcode123 base/test/scoped_feature_list.cc:123: std::string disables; On 2017/04/25 21:41:58, Ilya Sherman ...
3 years, 8 months ago (2017-04-26 01:04:40 UTC) #22
Ilya Sherman
Thanks! LGTM, but please wait for Alexei's review as well. https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc File base/test/scoped_feature_list.cc (right): https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc#newcode123 ...
3 years, 8 months ago (2017-04-26 07:19:20 UTC) #23
Alexei Svitkine (slow)
https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc File base/test/scoped_feature_list.cc (right): https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc#newcode123 base/test/scoped_feature_list.cc:123: std::string disables; On 2017/04/25 21:21:07, chaopeng wrote: > Re ...
3 years, 7 months ago (2017-04-27 14:58:08 UTC) #24
chaopeng
On 2017/04/27 14:58:08, Alexei Svitkine (slow) wrote: > https://codereview.chromium.org/2834583002/diff/80001/base/test/scoped_feature_list.cc > File base/test/scoped_feature_list.cc (right): > > ...
3 years, 7 months ago (2017-04-27 23:29:57 UTC) #25
Alexei Svitkine (slow)
lgtm
3 years, 7 months ago (2017-04-28 14:38:28 UTC) #26
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/2834583002/140001
3 years, 7 months ago (2017-04-28 14:43:58 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/423253)
3 years, 7 months ago (2017-04-28 14:53:36 UTC) #31
chaopeng
dcheng@chromium.org: Please review changes.
3 years, 7 months ago (2017-04-28 15:15:11 UTC) #33
chaopeng
thakis: PTAL. Thank you.
3 years, 7 months ago (2017-04-28 15:18:32 UTC) #35
Nico
rs-lgtm
3 years, 7 months ago (2017-04-28 20:42:21 UTC) #36
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/2834583002/140001
3 years, 7 months ago (2017-04-29 01:16:17 UTC) #38
commit-bot: I haz the power
Committed patchset #6 (id:140001) as https://chromium.googlesource.com/chromium/src/+/9c04ed553bd7abe820a6a93c5e8981e6738881a9
3 years, 7 months ago (2017-04-29 02:08:24 UTC) #41
findit-for-me
Findit(https://goo.gl/kROfz5) identified this CL at revision 468210 as the culprit for failures in the build ...
3 years, 7 months ago (2017-04-29 03:52:08 UTC) #42
Lei Zhang
3 years, 7 months ago (2017-04-30 20:58:13 UTC) #43
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:140001) has been created in
https://codereview.chromium.org/2850073002/ by thestig@chromium.org.

The reason for reverting is: Mac ASAN bots reporting use-after-free errors..

Powered by Google App Engine
This is Rietveld 408576698