Bug 602872 - Some Places xpcshell tests are failing due to idle-daily notified for each test. r=mak a=orange

This commit is contained in:
Marco Bonardo 2010-10-08 11:18:00 -04:00
Родитель 4850b5f10e
Коммит 59a6317501
3 изменённых файлов: 18 добавлений и 8 удалений

Просмотреть файл

@ -508,3 +508,21 @@ let (randomFailingSyncTests = [
sync.observe(null, "places-debug-stop-sync", null);
}
}
// These tests are randomly failing if idle-daily is executed in the middle,
// thus we make history ignore the notification for them. See bug 602872.
let (randomFailingIdleTests = [
"test_redirectsMode.js",
"test_tags.js",
"test_history_sidebar.js",
"test_removeVisitsByTimeframe.js",
"test_history_removeAllPages.js", // Needs stable frecency.
"test_database_sync_after_shutdown_with_removeAllPages.js", // Needs stable frecency.
]) {
let currentTestFilename = do_get_file(_TEST_FILE[0], true).leafName;
if (randomFailingIdleTests.indexOf(currentTestFilename) != -1) {
print("Test " + currentTestFilename +
" is known random due to idle-daily, remove observer.");
Services.obs.removeObserver(PlacesUtils.history, "idle-daily");
}
}

Просмотреть файл

@ -138,10 +138,6 @@ function run_test()
{
do_test_pending();
// Since we are checking frecency, we have to disable some stuff that could
// change values during test run. On idle-daily frecencies are updated.
Services.obs.removeObserver(PlacesUtils.history, "idle-daily");
// Set the preference for the timer to a really large value, so it won't
// run before the test finishes.
prefs.setIntPref(PREF_SYNC_INTERVAL, SYNC_INTERVAL);

Просмотреть файл

@ -237,10 +237,6 @@ os.addObserver(syncObserver, kSyncFinished, false);
// main
function run_test() {
// Since we are checking frecency, we have to disable some stuff that could
// change values during test run. On idle-daily frecencies are updated.
Services.obs.removeObserver(PlacesUtils.history, "idle-daily");
// Add a livemark with a visited and an unvisited child
add_fake_livemark();