diff --git a/toolkit/components/places/tests/cpp/test_IHistory.cpp b/toolkit/components/places/tests/cpp/test_IHistory.cpp index d417063042a..ddd04e251e9 100644 --- a/toolkit/components/places/tests/cpp/test_IHistory.cpp +++ b/toolkit/components/places/tests/cpp/test_IHistory.cpp @@ -39,6 +39,8 @@ #include "places_test_harness.h" #include "nsIBrowserHistory.h" +#include "nsIPrefService.h" +#include "nsIPrefBranch.h" #include "mock_Link.h" using namespace mozilla::dom; @@ -127,6 +129,22 @@ NS_IMPL_ISUPPORTS1( //////////////////////////////////////////////////////////////////////////////// //// Test Functions +void +test_set_places_enabled() +{ + // Ensure places is enabled for everyone. + nsresult rv; + nsCOMPtr prefBranch = + do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); + do_check_success(rv); + + rv = prefBranch->SetBoolPref("places.history.enabled", PR_TRUE); + do_check_success(rv); + + // Run the next test. + run_next_test(); +} + // These variables are shared between part 1 and part 2 of the test. Part 2 // sets the nsCOMPtr's to nsnull, freeing the reference. namespace test_unvisited_does_not_notify { @@ -585,6 +603,7 @@ test_two_null_links_same_uri() * Note: for tests marked "Order Important!", please see the test for details. */ Test gTests[] = { + TEST(test_set_places_enabled), // Must come first! TEST(test_unvisted_does_not_notify_part1), // Order Important! TEST(test_visited_notifies), TEST(test_unvisted_does_not_notify_part2), // Order Important!