New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 854812 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

If you don't call one of the Init() functions in base::test::ScopedFeatureList, then ~base::test::ScopedFeatureList resets features

Project Member Reported by sky@chromium.org, Jun 20 2018

Issue description

One of my patches was triggering a failure in a browser_test. This appeared to be happening because during startup a feature was enabled, and during shutdown it wasn't. I tracked this down to a browser test with base::test::ScopedFeatureList in it's test body, and no calls to Init(). AFAICT when ~ScopedFeatureList is called without a call to one the Inits(), all features are disabled.
 
Components: Internals>Metrics>Variations
Owner: asvitk...@chromium.org
Status: Assigned (was: Untriaged)
Status: Fixed (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/35f89c573cba18ebb018c88635c599a81203e352

commit 35f89c573cba18ebb018c88635c599a81203e352
Author: Alexei Svitkine <asvitkine@chromium.org>
Date: Fri Jun 22 20:43:40 2018

Make ScopedFeatureList a no-op if Init*() is never called on it.

Previously, it would clobber state when going out of scope, which
is undesirable.

Bug:  854812 
Change-Id: I2fd2859b28eed5e8247361da3b105068b348813b
Reviewed-on: https://chromium-review.googlesource.com/1112481
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569752}
[modify] https://crrev.com/35f89c573cba18ebb018c88635c599a81203e352/base/test/scoped_feature_list.cc
[modify] https://crrev.com/35f89c573cba18ebb018c88635c599a81203e352/base/test/scoped_feature_list.h
[modify] https://crrev.com/35f89c573cba18ebb018c88635c599a81203e352/base/test/scoped_feature_list_unittest.cc

Sign in to add a comment