diff options
Diffstat (limited to 'common/src/com/android/tv/common/feature/TestableFeature.java')
-rw-r--r-- | common/src/com/android/tv/common/feature/TestableFeature.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/src/com/android/tv/common/feature/TestableFeature.java b/common/src/com/android/tv/common/feature/TestableFeature.java index a02877ec..d7e707a1 100644 --- a/common/src/com/android/tv/common/feature/TestableFeature.java +++ b/common/src/com/android/tv/common/feature/TestableFeature.java @@ -36,14 +36,29 @@ public class TestableFeature implements Feature { private final Feature mDelegate; private Boolean mTestValue = null; + /** + * Creates testable feature. + */ public static TestableFeature createTestableFeature(Feature delegate) { return new TestableFeature(delegate); } + /** + * Creates testable feature with initial value. + */ + public static TestableFeature createTestableFeature(Feature delegate, Boolean initialValue) { + return new TestableFeature(delegate, initialValue); + } + private TestableFeature(Feature delegate) { mDelegate = delegate; } + private TestableFeature(Feature delegate, Boolean initialValue) { + mDelegate = delegate; + mTestValue = initialValue; + } + @VisibleForTesting public void enableForTest() { if (!TvCommonUtils.isRunningInTest()) { |