зеркало из https://github.com/mozilla/gecko-dev.git
Bug 966244 - Part 2: Update tests. r=gene
This commit is contained in:
Родитель
ae10708769
Коммит
1cbc513fd3
|
@ -19,6 +19,10 @@ function clearStore(store, callback) {
|
|||
}, callback);
|
||||
}
|
||||
|
||||
function getNetworkId(aIccId, aNetworkType) {
|
||||
return aIccId + '' + aNetworkType;
|
||||
}
|
||||
|
||||
add_test(function prepareDatabase() {
|
||||
// Clear whole database to avoid starting tests with unknown state
|
||||
// due to the previous tests.
|
||||
|
@ -121,6 +125,10 @@ add_test(function test_fillResultSamples_noEmptyData() {
|
|||
|
||||
add_test(function test_clear() {
|
||||
var networks = getNetworks();
|
||||
networks.forEach(function(network, index) {
|
||||
networks[index] = {network: network, networkId: getNetworkId(network.id, network.type)};
|
||||
}, this);
|
||||
|
||||
netStatsDb.clearStats(networks, function (error, result) {
|
||||
do_check_eq(error, null);
|
||||
run_next_test();
|
||||
|
@ -129,6 +137,10 @@ add_test(function test_clear() {
|
|||
|
||||
add_test(function test_clear_interface() {
|
||||
var networks = getNetworks();
|
||||
networks.forEach(function(network, index) {
|
||||
networks[index] = {network: network, networkId: getNetworkId(network.id, network.type)};
|
||||
}, this);
|
||||
|
||||
netStatsDb.clearInterfaceStats(networks[0], function (error, result) {
|
||||
do_check_eq(error, null);
|
||||
run_next_test();
|
||||
|
|
|
@ -19,8 +19,12 @@ add_test(function test_clearDB() {
|
|||
getNetworks(function onGetNetworks(error, result) {
|
||||
do_check_eq(error, null);
|
||||
var networks = result;
|
||||
networks.forEach(function(network, index) {
|
||||
networks[index] = {network: network, networkId: NetworkStatsService.getNetworkId(network.id, network.type)};
|
||||
}, this);
|
||||
|
||||
NetworkStatsService._db.clearStats(networks, function onDBCleared(error, result) {
|
||||
do_check_eq(result, null);
|
||||
do_check_eq(error, null);
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче