Clear logcat before every monkey test
Bug 6681325
Change-Id: I5fee05f76306d1eda61f21b0dd0d62f037f95158
diff --git a/hostsidetests/monkey/src/com/android/cts/monkey/AbstractMonkeyTest.java b/hostsidetests/monkey/src/com/android/cts/monkey/AbstractMonkeyTest.java
index 0bc2c10..36dae9d 100644
--- a/hostsidetests/monkey/src/com/android/cts/monkey/AbstractMonkeyTest.java
+++ b/hostsidetests/monkey/src/com/android/cts/monkey/AbstractMonkeyTest.java
@@ -31,6 +31,7 @@
File app = mBuild.getTestApp(APKS[i]);
mDevice.installPackage(app, false);
}
+ clearLogCat();
}
@Override
@@ -41,7 +42,7 @@
}
}
- void clearLogCat() throws DeviceNotAvailableException {
+ private void clearLogCat() throws DeviceNotAvailableException {
mDevice.executeAdbCommand("logcat", "-c");
}
}
diff --git a/hostsidetests/monkey/src/com/android/cts/monkey/MonkeyTest.java b/hostsidetests/monkey/src/com/android/cts/monkey/MonkeyTest.java
index 17a5cf8..f38b332 100644
--- a/hostsidetests/monkey/src/com/android/cts/monkey/MonkeyTest.java
+++ b/hostsidetests/monkey/src/com/android/cts/monkey/MonkeyTest.java
@@ -19,8 +19,6 @@
import com.android.tradefed.device.DeviceNotAvailableException;
import java.util.Scanner;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
public class MonkeyTest extends AbstractMonkeyTest {
@@ -28,13 +26,11 @@
private static final String HUMAN = "(^_^)";
public void testIsMonkey() throws Exception {
- clearLogCat();
mDevice.executeShellCommand("monkey -p " + PKGS[0] + " 500");
assertIsUserAMonkey(true);
}
public void testNotMonkey() throws Exception {
- clearLogCat();
mDevice.executeShellCommand("am start -W -a android.intent.action.MAIN "
+ "-n com.android.cts.monkey/com.android.cts.monkey.MonkeyActivity");
assertIsUserAMonkey(false);