From 899caf2cf473e512567832d283e9750679f0bf4d Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Fri, 7 Aug 2015 16:36:11 -0700 Subject: [PATCH] [SuwLib] Fix unit tests hideSystemBars is no-op in versions < lollipop. Change-Id: I2eaab0f044c4fe69511d09e6f0622c6c20979fe6 --- .../android/setupwizardlib/test/SystemBarHelperTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/test/src/com/android/setupwizardlib/test/SystemBarHelperTest.java b/library/test/src/com/android/setupwizardlib/test/SystemBarHelperTest.java index b34400e..fb5d7bb 100644 --- a/library/test/src/com/android/setupwizardlib/test/SystemBarHelperTest.java +++ b/library/test/src/com/android/setupwizardlib/test/SystemBarHelperTest.java @@ -19,6 +19,7 @@ package com.android.setupwizardlib.test; import android.annotation.SuppressLint; import android.app.Dialog; import android.content.Context; +import android.os.Build; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.os.Handler; @@ -121,7 +122,10 @@ public class SystemBarHelperTest extends AndroidTestCase { SystemClock.sleep(500); // Wait for the looper to drain all the messages thread.quit(); // Initial peek + 3 retries = 4 tries total - assertEquals("Peek decor view should give up after 4 tries", 4, window.peekDecorViewCount); + if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { + assertEquals("Peek decor view should give up after 4 tries", 4, + window.peekDecorViewCount); + } } @SmallTest