summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/tests/coretests/src/android/view/textclassifier/ActionsSuggestionsHelperTest.java1
-rw-r--r--core/tests/systemproperties/src/android/os/SystemPropertiesTest.java2
-rw-r--r--services/tests/servicestests/src/com/android/server/backup/BackupManagerServiceTest.java4
-rw-r--r--services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java1
-rw-r--r--services/tests/servicestests/src/com/android/server/backup/utils/FileUtilsTest.java16
-rw-r--r--services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java1
-rw-r--r--services/tests/uiservicestests/src/com/android/server/notification/NotificationHistoryManagerTest.java3
-rwxr-xr-xservices/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java2
8 files changed, 20 insertions, 10 deletions
diff --git a/core/tests/coretests/src/android/view/textclassifier/ActionsSuggestionsHelperTest.java b/core/tests/coretests/src/android/view/textclassifier/ActionsSuggestionsHelperTest.java
index 80bce264c11b..ec7e83f1f243 100644
--- a/core/tests/coretests/src/android/view/textclassifier/ActionsSuggestionsHelperTest.java
+++ b/core/tests/coretests/src/android/view/textclassifier/ActionsSuggestionsHelperTest.java
@@ -238,6 +238,7 @@ public class ActionsSuggestionsHelperTest {
assertThat(conversationActions).isEmpty();
}
+ @Test
public void createLabeledIntentResult_null() {
ActionsSuggestionsModel.ActionSuggestion nativeSuggestion =
new ActionsSuggestionsModel.ActionSuggestion(
diff --git a/core/tests/systemproperties/src/android/os/SystemPropertiesTest.java b/core/tests/systemproperties/src/android/os/SystemPropertiesTest.java
index 9f70538191c2..67783bff9299 100644
--- a/core/tests/systemproperties/src/android/os/SystemPropertiesTest.java
+++ b/core/tests/systemproperties/src/android/os/SystemPropertiesTest.java
@@ -94,7 +94,7 @@ public class SystemPropertiesTest extends TestCase {
}
@SmallTest
- private static void testHandle() throws Exception {
+ public void testHandle() throws Exception {
String value;
SystemProperties.Handle handle = SystemProperties.find("doesnotexist_2341431");
assertNull(handle);
diff --git a/services/tests/servicestests/src/com/android/server/backup/BackupManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/backup/BackupManagerServiceTest.java
index 9f8ca7fc55a5..2326dfda7e12 100644
--- a/services/tests/servicestests/src/com/android/server/backup/BackupManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/BackupManagerServiceTest.java
@@ -56,6 +56,7 @@ import com.android.server.backup.utils.RandomAccessFileUtils;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -513,6 +514,8 @@ public class BackupManagerServiceTest {
verifyNoMoreInteractions(mUserBackupManagerService);
}
+ @Test
+ @Ignore("b/147012496")
public void testGetUserForAncestralSerialNumber() {
BackupManagerServiceTestable.sBackupDisabled = false;
BackupManagerService backupManagerService =
@@ -524,6 +527,7 @@ public class BackupManagerServiceTest {
assertThat(user).isEqualTo(UserHandle.of(1));
}
+ @Test
public void testGetUserForAncestralSerialNumber_whenDisabled() {
BackupManagerServiceTestable.sBackupDisabled = true;
BackupManagerService backupManagerService =
diff --git a/services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java b/services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java
index 4e7fe44b2b76..0e918db321e3 100644
--- a/services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java
@@ -136,6 +136,7 @@ public class DataChangedJournalTest {
assertThat(mJournal.toString()).isEqualTo(mFile.toString());
}
+ @Test
public void listJournals_invalidJournalFile_returnsEmptyList() throws Exception {
when(invalidFile.listFiles()).thenReturn(null);
diff --git a/services/tests/servicestests/src/com/android/server/backup/utils/FileUtilsTest.java b/services/tests/servicestests/src/com/android/server/backup/utils/FileUtilsTest.java
index eaa9c4520979..d54aa3b1c2f6 100644
--- a/services/tests/servicestests/src/com/android/server/backup/utils/FileUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/utils/FileUtilsTest.java
@@ -27,7 +27,6 @@ import com.google.common.io.Files;
import org.junit.AfterClass;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -41,11 +40,6 @@ public class FileUtilsTest {
private static File sTemporaryDir;
private File mTemporaryFile;
- @BeforeClass
- public static void setUpClass() {
- sTemporaryDir = Files.createTempDir();
- }
-
@AfterClass
public static void tearDownClass() {
if (sTemporaryDir != null) {
@@ -55,17 +49,21 @@ public class FileUtilsTest {
@Before
public void setUp() throws Exception {
+ if (sTemporaryDir != null) {
+ sTemporaryDir.delete();
+ }
+ sTemporaryDir = Files.createTempDir();
mTemporaryFile = new File(sTemporaryDir, "fileutilstest.txt");
}
/** Test that if file does not exist, {@link FileUtils#createNewFile()} creates the file. */
@Test
public void testEnsureFileExists_fileDoesNotAlreadyExist_getsCreated() {
- assertThat(!mTemporaryFile.exists());
+ assertThat(mTemporaryFile.exists()).isFalse();
FileUtils.createNewFile(mTemporaryFile);
- assertThat(mTemporaryFile.exists());
+ assertThat(mTemporaryFile.exists()).isTrue();
}
/** Test that if file does exist, {@link FileUtils#createNewFile()} does not error out. */
@@ -75,6 +73,6 @@ public class FileUtilsTest {
FileUtils.createNewFile(mTemporaryFile);
- assertThat(mTemporaryFile.exists());
+ assertThat(mTemporaryFile.exists()).isTrue();
}
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java
index 0a1899be8c1f..50ed975263e0 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java
@@ -534,6 +534,7 @@ public class HdmiCecLocalDeviceAudioSystemTest {
assertThat(mNativeWrapper.getOnlyResultMessage()).isEqualTo(expectedMessage);
}
+ @Test
public void handleSystemAudioModeRequest_fromNonTV_tVNotSupport() {
HdmiCecMessage message =
HdmiCecMessageBuilder.buildSystemAudioModeRequest(
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationHistoryManagerTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationHistoryManagerTest.java
index 92c05466deb5..3b6a4bde8e20 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationHistoryManagerTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationHistoryManagerTest.java
@@ -41,6 +41,7 @@ import androidx.test.runner.AndroidJUnit4;
import com.android.server.UiServiceTestCase;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -124,6 +125,8 @@ public class NotificationHistoryManagerTest extends UiServiceTestCase {
verify(mDb, times(1)).init();
}
+ @Test
+ @Ignore("b/147012298")
public void testOnUserUnlocked_historyDisabled() {
Settings.Secure.putIntForUser(getContext().getContentResolver(),
Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0, USER_SYSTEM);
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 876e77acde86..95617b1162a8 100755
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -4502,6 +4502,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
assertEquals(0, mService.countLogSmartSuggestionsVisible);
}
+ @Test
public void testReportSeen_delegated() {
Notification.Builder nb =
new Notification.Builder(mContext, mTestNotificationChannel.getId())
@@ -5767,6 +5768,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
verify(mUsageStats, times(5)).registerImageRemoved(PKG);
}
+ @Test
public void testNotificationBubbles_flagAutoExpandForeground_fails_notForeground()
throws Exception {
// Bubbles are allowed!