summaryrefslogtreecommitdiffstats
path: root/core/tests/bandwidthtests/src/com
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-10-31 16:37:52 -0700
committerJeff Sharkey <jsharkey@android.com>2011-11-02 15:14:11 -0700
commit163e6443f27884a9bfcb9a48ef606dc635852c23 (patch)
treeeb308345d0b83c32ca9da79eecad23cc0fdab3fc /core/tests/bandwidthtests/src/com
parent7a5a50c12f6a6e094d1e8aa7514df37f1176354a (diff)
downloadframeworks_base-163e6443f27884a9bfcb9a48ef606dc635852c23.zip
frameworks_base-163e6443f27884a9bfcb9a48ef606dc635852c23.tar.gz
frameworks_base-163e6443f27884a9bfcb9a48ef606dc635852c23.tar.bz2
Correct proc file reader, optimizations.
Moved away from BufferedReader, which only reads the first 8KB of some proc files because it aggresively fills its buffer. Optimized proc parsing, now double the speed. Tests to cover. Log when NetworkStats counters roll backwards when subtracting, and optimizations around findIndex(). When system removes UID, also remove from last stats snapshot to avoid xt counters from rolling backwards. Bug: 5472949, 5458380 Change-Id: I07c08fe5233156fac2b84450f6291868bf9bfaf2
Diffstat (limited to 'core/tests/bandwidthtests/src/com')
-rw-r--r--core/tests/bandwidthtests/src/com/android/bandwidthtest/BandwidthTest.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/tests/bandwidthtests/src/com/android/bandwidthtest/BandwidthTest.java b/core/tests/bandwidthtests/src/com/android/bandwidthtest/BandwidthTest.java
index 9eee2f0..0cc883f 100644
--- a/core/tests/bandwidthtests/src/com/android/bandwidthtest/BandwidthTest.java
+++ b/core/tests/bandwidthtests/src/com/android/bandwidthtest/BandwidthTest.java
@@ -89,7 +89,7 @@ public class BandwidthTest extends InstrumentationTestCase {
* Ensure that downloading on wifi reports reasonable stats.
*/
@LargeTest
- public void testWifiDownload() {
+ public void testWifiDownload() throws Exception {
assertTrue(setDeviceWifiAndAirplaneMode(mSsid));
NetworkStats pre_test_stats = fetchDataFromProc(mUid);
String ts = Long.toString(System.currentTimeMillis());
@@ -123,7 +123,7 @@ public class BandwidthTest extends InstrumentationTestCase {
* Ensure that downloading on wifi reports reasonable stats.
*/
@LargeTest
- public void testWifiUpload() {
+ public void testWifiUpload() throws Exception {
assertTrue(setDeviceWifiAndAirplaneMode(mSsid));
// Download a file from the server.
String ts = Long.toString(System.currentTimeMillis());
@@ -160,7 +160,7 @@ public class BandwidthTest extends InstrumentationTestCase {
* accounting still goes to the app making the call and that the numbers still make sense.
*/
@LargeTest
- public void testWifiDownloadWithDownloadManager() {
+ public void testWifiDownloadWithDownloadManager() throws Exception {
assertTrue(setDeviceWifiAndAirplaneMode(mSsid));
// If we are using the download manager, then the data that is written to /proc/uid_stat/
// is accounted against download manager's uid, since it uses pre-ICS API.