• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 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 org.robolectric.annotation.Implementation;
8 import org.robolectric.annotation.Implements;
9 import org.robolectric.annotation.Resetter;
10 
11 import org.chromium.base.BuildInfo;
12 
13 /** Shadow class of {@link BuildInfo} */
14 @Implements(BuildInfo.class)
15 public class ShadowBuildInfo {
16     private static boolean sTargetsAtLeastT;
17 
18     /** Rests the changes made to static state. */
19     @Resetter
reset()20     public static void reset() {
21         sTargetsAtLeastT = false;
22     }
23 
24     /** Whether the current build is targeting at least T. */
25     @Implementation
targetsAtLeastT()26     public static boolean targetsAtLeastT() {
27         return sTargetsAtLeastT;
28     }
29 
30     /** Sets whether the current build is targeting at least T. */
setTargetsAtLeastT(boolean targetsAtLeastT)31     public static void setTargetsAtLeastT(boolean targetsAtLeastT) {
32         sTargetsAtLeastT = targetsAtLeastT;
33     }
34 }
35