Merge "Refine optimize page log pattern" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d865ccc2ed
@@ -57,17 +57,18 @@ public final class BatteryHistoricalLogUtilTest {
|
||||
BatteryHistoricalLogUtil.writeLog(mContext, Action.APPLY, "pkg1", "logs");
|
||||
BatteryHistoricalLogUtil.printBatteryOptimizeHistoricalLog(mContext, mTestPrintWriter);
|
||||
|
||||
assertThat(mTestStringWriter.toString()).contains("pkg1\tAction:APPLY\tEvent:logs");
|
||||
assertThat(mTestStringWriter.toString()).contains(
|
||||
"pkg1\tAction:APPLY\tEvent:logs\tTimestamp:");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void writeLog_multipleLogs_withCorrectCounts() {
|
||||
for (int i = 0; i < BatteryHistoricalLogUtil.MAX_ENTRIES; i++) {
|
||||
BatteryHistoricalLogUtil.writeLog(mContext, Action.MANUAL, "pkg" + i, "logs");
|
||||
BatteryHistoricalLogUtil.writeLog(mContext, Action.LEAVE, "pkg" + i, "logs");
|
||||
}
|
||||
BatteryHistoricalLogUtil.printBatteryOptimizeHistoricalLog(mContext, mTestPrintWriter);
|
||||
|
||||
assertThat(mTestStringWriter.toString().split("MANUAL").length).isEqualTo(41);
|
||||
assertThat(mTestStringWriter.toString().split("LEAVE").length).isEqualTo(41);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user