OSDN Git Service

Fix robotest failure for ChartDataUsagePreferenceTest.
authorDoris Ling <dling@google.com>
Tue, 10 Apr 2018 01:03:20 +0000 (18:03 -0700)
committerDoris Ling <dling@google.com>
Tue, 10 Apr 2018 01:12:46 +0000 (18:12 -0700)
commitc8613c7930aa28e0aa81b359a87ee03353f7fb69
tree4cb600dae596c601ee8571bc7e7aaaef02b9005c
parente9b6d482cbefaa04b49519d91191136795011c42
Fix robotest failure for ChartDataUsagePreferenceTest.

- the chart usage data is computed using difference between current time
and the timestamp from the usage data. In the test, we are using actual
current time and mock usage data. As the current time varies the test
computating sometimes results in some negative data, and makes the
comparison unpredictable. Change to use a fix "current" time in the test
so that the time difference in computation will be constant.

Fixes: 77824818
Test: make RunSettingsRoboTests
Change-Id: I2d8c166839775469d30015317afdc04eb3d9a2b4
tests/robotests/src/com/android/settings/datausage/ChartDataUsagePreferenceTest.java