Skip to content
Snippets Groups Projects
Commit 190310c6 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4500033 from f2ff76c1 to pi-release

Change-Id: I420cb79ff5910444b9bc23c6dca189f830b58ec0
parents 8ef19bbd f2ff76c1
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,9 @@ import com.android.loganalysis.item.BatteryStatsSummaryInfoItem; ...@@ -20,7 +20,9 @@ import com.android.loganalysis.item.BatteryStatsSummaryInfoItem;
import junit.framework.TestCase; import junit.framework.TestCase;
import java.util.Arrays; import java.util.Arrays;
import java.util.GregorianCalendar;
import java.util.List; import java.util.List;
import java.util.TimeZone;
/** /**
* Unit tests for {@link BatteryStatsSummaryInfoParser} * Unit tests for {@link BatteryStatsSummaryInfoParser}
...@@ -83,8 +85,14 @@ public class BatteryStatsSummaryInfoParserTest extends TestCase { ...@@ -83,8 +85,14 @@ public class BatteryStatsSummaryInfoParserTest extends TestCase {
assertEquals("The battery dropped a level 24 mins on average", assertEquals("The battery dropped a level 24 mins on average",
summary.getBatteryDischargeRate()); summary.getBatteryDischargeRate());
assertEquals("The peak discharge time was during Tue Dec 09 16:31:07 PST 2014 to " // Get the current timezone short name (PST, GMT) to properly output the time as expected.
+ "Tue Dec 09 19:35:52 PST 2014 where battery dropped from 89 to 80", String timezone =
new GregorianCalendar().getTimeZone().getDisplayName(false, TimeZone.SHORT);
assertEquals(
String.format(
"The peak discharge time was during Tue Dec 09 16:31:07 %s 2014 to "
+ "Tue Dec 09 19:35:52 %s 2014 where battery dropped from 89 to 80",
timezone, timezone),
summary.getPeakDischargeTime()); summary.getPeakDischargeTime());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment