Bug 614550 - Ensure places is enabled for places related c++ tests; r=mak, a=test-only change

This commit is contained in:
Mark Banner 2010-11-24 15:13:47 +00:00
Родитель dea04ce175
Коммит a80f3b12ce
1 изменённых файлов: 19 добавлений и 0 удалений

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

@ -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<nsIPrefBranch> 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!