1 // Copyright 2022 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.base.test; 6 7 import android.content.Context; 8 9 import org.junit.runners.model.FrameworkMethod; 10 11 import org.chromium.base.Flag; 12 import org.chromium.base.test.BaseJUnit4ClassRunner.TestHook; 13 14 /** Resets any cached values held by active {@link Flag} instances. */ 15 public class ResetCachedFlagValuesTestHook implements TestHook { 16 @Override run(Context targetContext, FrameworkMethod testMethod)17 public void run(Context targetContext, FrameworkMethod testMethod) { 18 Flag.resetAllInMemoryCachedValuesForTesting(); 19 } 20 } 21