Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f52eeb37 authored by Ben Reich's avatar Ben Reich
Browse files

Don't run IconHelperTest on devcies with HSUM

On devices with HSUM the system user is not a real user. This means the
main user will typically NOT be the system user. Thus the test
testShouldShowBadge_returnFalse_onSystemUser will fail on these devices.
However, the system user doesn't ever use DocumentsUI on these devices
(as it's truly the system user) and thus the test is actually not
helpful on these devices.

Fix: 383281556
Test: atest com.android.documentsui.dirlist.IconHelperTest
Flag: EXEMPT Test fix
Change-Id: I4955e13c2b17a31ea05813e2e235501d5580b2c8
parent df2b0e0a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.documentsui.dirlist;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.TruthJUnit.assume;

import android.content.Context;
import android.os.UserHandle;
@@ -87,6 +88,10 @@ public final class IconHelperTest {

    @Test
    public void testShouldShowBadge_returnFalse_onSystemUser() {
        // In HSUM setups the system user will not be a real user and thus DocumentsUI won't be used
        // in this situation. Let's assume the current user is a system user (thus the test is
        // running on a non-HSUM device).
        assume().that(UserId.CURRENT_USER.isSystem()).isTrue();
        assertThat(mIconHelper.shouldShowBadge(mSystemUser.getIdentifier())).isFalse();
    }