Merge "Fix volume CSD tests not cleanring up" into udc-dev

This commit is contained in:
Behnam Heydarshahi
2023-04-13 19:02:41 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 0 deletions

View File

@@ -2343,6 +2343,13 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
}
}
@VisibleForTesting
void clearInternalHandleAfterTest() {
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
}
}
private final class CustomDialog extends Dialog implements DialogInterface {
public CustomDialog(Context context) {
super(context, R.style.volume_dialog_theme);

View File

@@ -58,6 +58,7 @@ import com.android.systemui.util.DeviceConfigProxyFake;
import com.android.systemui.util.concurrency.FakeExecutor;
import com.android.systemui.util.time.FakeSystemClock;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -370,6 +371,13 @@ public class VolumeDialogImplTest extends SysuiTestCase {
verify(mCsdWarningDialog).show();
}
@After
public void teardown() {
if (mDialog != null) {
mDialog.clearInternalHandleAfterTest();
}
}
/*
@Test
public void testContentDescriptions() {