mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1044737
- 3/3: fix NetworkStatsService::networkStatsAvailable and test cases. r=vchang
This commit is contained in:
parent
c494c71cd3
commit
13386a0233
@ -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 };
|
||||
|
@ -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());
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user