mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 966244 - Part 2: Update tests. r=gene
This commit is contained in:
parent
9ec314f9f4
commit
16ff07b731
@ -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();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user