Bug 1044737 - 3/3: fix NetworkStatsService::networkStatsAvailable and test cases. r=vchang

This commit is contained in:
Vicamo Yang 2014-08-01 15:08:42 +08:00
parent c494c71cd3
commit 13386a0233
2 changed files with 4 additions and 4 deletions

View File

@ -691,7 +691,7 @@ this.NetworkStatsService = {
*/
networkStatsAvailable: function networkStatsAvailable(aCallback, aNetId,
aResult, aRxBytes,
aTxBytes, aDate) {
aTxBytes, aTimestamp) {
if (!aResult) {
if (aCallback) {
aCallback(false, "Netd IPC error");
@ -703,7 +703,7 @@ this.NetworkStatsService = {
serviceType: "",
networkId: this._networks[aNetId].network.id,
networkType: this._networks[aNetId].network.type,
date: aDate,
date: new Date(aTimestamp),
rxBytes: aTxBytes,
txBytes: aRxBytes,
isAccumulative: true };

View File

@ -47,7 +47,7 @@ add_test(function test_networkStatsAvailable_ok() {
NetworkStatsService.networkStatsAvailable(function (success, msg) {
do_check_eq(success, true);
run_next_test();
}, netId, true, 1234, 4321, new Date());
}, netId, true, 1234, 4321, Date.now());
});
});
@ -58,7 +58,7 @@ add_test(function test_networkStatsAvailable_failure() {
NetworkStatsService.networkStatsAvailable(function (success, msg) {
do_check_eq(success, false);
run_next_test();
}, netId, false, 1234, 4321, new Date());
}, netId, false, 1234, 4321, Date.now());
});
});