More CTS test cleanup.
Omit broken tests, and fix race condition in TelephonyManagerTes#@testListen.
Bugs 2342468, 2189784, 2323047, 2342606
Change-Id: I8193b3130248ade8a2ede5f997d9522a1b2a5529
diff --git a/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java b/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java
index a8b05c1..0a86a5e 100644
--- a/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java
+++ b/tests/tests/accounts/src/android/accounts/cts/AccountManagerTest.java
@@ -16,19 +16,17 @@
package android.accounts.cts;
+import dalvik.annotation.KnownFailure;
+
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerFuture;
-import android.accounts.AuthenticatorDescription;
import android.os.Bundle;
import android.test.AndroidTestCase;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
public class AccountManagerTest extends AndroidTestCase {
+ @KnownFailure(value="failure removing account bug 2342468")
public void testAddAndRemoveAccount() throws Exception {
AccountManager am = AccountManager.get(getContext());
diff --git a/tests/tests/app/src/android/app/cts/ActivityGroupTest.java b/tests/tests/app/src/android/app/cts/ActivityGroupTest.java
index 1cc808e..05287cd 100644
--- a/tests/tests/app/src/android/app/cts/ActivityGroupTest.java
+++ b/tests/tests/app/src/android/app/cts/ActivityGroupTest.java
@@ -235,6 +235,7 @@
args = {}
)
})
+ @BrokenTest(value="bug 2189784, needs investigation")
public void testTabDialog() throws Exception {
mIntent = mTabIntent;
runLaunchpad(LaunchpadActivity.LIFECYCLE_DIALOG);
diff --git a/tests/tests/content/src/android/content/cts/ContextWrapperTest.java b/tests/tests/content/src/android/content/cts/ContextWrapperTest.java
index 9239725..1d9affa5 100644
--- a/tests/tests/content/src/android/content/cts/ContextWrapperTest.java
+++ b/tests/tests/content/src/android/content/cts/ContextWrapperTest.java
@@ -380,6 +380,7 @@
args = {String.class}
)
})
+ @BrokenTest(value="bug 2323047")
public void testAccessOfFiles() throws IOException, FileNotFoundException {
int TEST_LENGTH = 10;
String[] fileLst;
@@ -451,7 +452,7 @@
for (String file: fileLst) {
// Test deleteFile(String)
- mContextWrapper.deleteFile(file);
+ assertTrue(mContextWrapper.deleteFile(file));
}
fileLst = mContextWrapper.fileList();
assertEquals(originalNumFiles, fileLst.length);
diff --git a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
index 7741a2f..90b2bf9 100644
--- a/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/TelephonyManagerTest.java
@@ -115,10 +115,7 @@
CellLocation.requestLocationUpdate();
synchronized (mLock) {
- while (!mOnCellLocationChangedCalled) {
- mLock.wait(TOLERANCE);
- break;
- }
+ mLock.wait(TOLERANCE);
}
mLooper.quit();
assertFalse(mOnCellLocationChangedCalled);