Bug 751813 - Stop spewing to the console about Places Maintenance.

r=paolo
This commit is contained in:
Marco Bonardo 2012-09-12 12:02:07 +02:00
parent 54504a53cb
commit 80d98fd960
3 changed files with 2 additions and 45 deletions

View File

@ -35,8 +35,7 @@ XPCOMUtils.defineLazyGetter(this, "DBConn", function() {
let PlacesDBUtils = {
/**
* Executes a list of maintenance tasks.
* Once finished it will pass a array log to the callback attached to tasks,
* or print out to the error console if no callback is defined.
* Once finished it will pass a array log to the callback attached to tasks.
* FINISHED_MAINTENANCE_TOPIC is notified through observer service on finish.
*
* @param aTasks
@ -66,14 +65,6 @@ let PlacesDBUtils = {
let scope = aTasks.scope || Cu.getGlobalForObject(aTasks.callback);
aTasks.callback.call(scope, aTasks.messages);
}
else {
// Output to the error console.
let messages = aTasks.messages;
messages.unshift("[ Places Maintenance ]");
try {
Services.console.logStringMessage(messages.join("\n"));
} catch(ex) {}
}
// Notify observers that maintenance finished.
Services.prefs.setIntPref("places.database.lastMaintenance", parseInt(Date.now() / 1000));
@ -1007,8 +998,7 @@ let PlacesDBUtils = {
* this module.
* @param [optional] aCallback
* Callback to be invoked when done. It will receive an array of
* log messages. If not specified the log will be printed to the
* Error Console.
* log messages.
*/
runTasks: function PDBU_runTasks(aTasks, aCallback) {
let tasks = new Tasks(aTasks);

View File

@ -1,32 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that preventive maintenance outputs to the console.
*/
// Include PlacesDBUtils module.
Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");
function run_test() {
do_test_pending();
// Ensure a database exists.
PlacesUtils.history;
let consoleListener = {
observe: function(aMsg) {
do_log_info("Got console message:\n" + aMsg.message);
do_check_eq(aMsg.message.split("\n")[0], "[ Places Maintenance ]");
Services.console.unregisterListener(this);
do_test_finished();
},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIConsoleListener
]),
};
Services.console.reset();
Services.console.registerListener(consoleListener);
PlacesDBUtils.reindex();
}

View File

@ -102,7 +102,6 @@ skip-if = os == "android"
[test_preventive_maintenance_checkAndFixDatabase.js]
# Bug 676989: test hangs consistently on Android
skip-if = os == "android"
[test_preventive_maintenance_console.js]
[test_preventive_maintenance_runTasks.js]
[test_removeVisitsByTimeframe.js]
# Bug 676989: test hangs consistently on Android