diff --git a/toolkit/components/places/tests/head_common.js b/toolkit/components/places/tests/head_common.js index 8e5a5866e203..87707ba2c248 100644 --- a/toolkit/components/places/tests/head_common.js +++ b/toolkit/components/places/tests/head_common.js @@ -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"); + } +} diff --git a/toolkit/components/places/tests/sync/test_database_sync_after_shutdown_with_removeAllPages.js b/toolkit/components/places/tests/sync/test_database_sync_after_shutdown_with_removeAllPages.js index af75b9b2a669..4c68a2325dbb 100644 --- a/toolkit/components/places/tests/sync/test_database_sync_after_shutdown_with_removeAllPages.js +++ b/toolkit/components/places/tests/sync/test_database_sync_after_shutdown_with_removeAllPages.js @@ -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); diff --git a/toolkit/components/places/tests/unit/test_history_removeAllPages.js b/toolkit/components/places/tests/unit/test_history_removeAllPages.js index 238ec90f511a..48aa75a8138b 100644 --- a/toolkit/components/places/tests/unit/test_history_removeAllPages.js +++ b/toolkit/components/places/tests/unit/test_history_removeAllPages.js @@ -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();