Add tests for TaskbarStashController.
Test: TaskbarStashControllerTest Bug: 346394503 Flag: TEST_ONLY Change-Id: I930e745826f2512d04434ad689a3e42cac7e9901
This commit is contained in:
1 parent
c2c7913134
commit
3231ba01e6
4 files changed
+734
-15
No files matched your search
@@ -20,6 +20,8 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.SystemClock;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
public class Alarm implements Runnable{
|
||||
// if we reach this time and the alarm hasn't been cancelled, call the listener
|
||||
private long mAlarmTriggerTime;
|
||||
@@ -96,4 +98,13 @@ public class Alarm implements Runnable{
|
||||
public long getLastSetTimeout() {
|
||||
return mLastSetTimeout;
|
||||
}
|
||||
|
||||
/** Simulates the alarm firing for tests. */
|
||||
@VisibleForTesting
|
||||
public void finishAlarm() {
|
||||
if (!mAlarmPending) return;
|
||||
mAlarmPending = false;
|
||||
mHandler.removeCallbacks(this);
|
||||
mAlarmListener.onAlarm(this);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user