michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "places_test_harness.h" michael@0: #include "nsIPrefService.h" michael@0: #include "nsIPrefBranch.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: #include "mock_Link.h" michael@0: using namespace mozilla; michael@0: using namespace mozilla::dom; michael@0: michael@0: /** michael@0: * This file tests the IHistory interface. michael@0: */ michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: //// Helper Methods michael@0: michael@0: void michael@0: expect_visit(nsLinkState aState) michael@0: { michael@0: do_check_true(aState == eLinkState_Visited); michael@0: } michael@0: michael@0: void michael@0: expect_no_visit(nsLinkState aState) michael@0: { michael@0: do_check_true(aState == eLinkState_Unvisited); michael@0: } michael@0: michael@0: already_AddRefed michael@0: new_test_uri() michael@0: { michael@0: // Create a unique spec. michael@0: static int32_t specNumber = 0; michael@0: nsAutoCString spec = NS_LITERAL_CSTRING("http://mozilla.org/"); michael@0: spec.AppendInt(specNumber++); michael@0: michael@0: // Create the URI for the spec. michael@0: nsCOMPtr testURI; michael@0: nsresult rv = NS_NewURI(getter_AddRefs(testURI), spec); michael@0: do_check_success(rv); michael@0: return testURI.forget(); michael@0: } michael@0: michael@0: class VisitURIObserver MOZ_FINAL : public nsIObserver michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: VisitURIObserver(int aExpectedVisits = 1) : michael@0: mVisits(0), michael@0: mExpectedVisits(aExpectedVisits) michael@0: { michael@0: nsCOMPtr observerService = michael@0: do_GetService(NS_OBSERVERSERVICE_CONTRACTID); michael@0: do_check_true(observerService); michael@0: (void)observerService->AddObserver(this, michael@0: "uri-visit-saved", michael@0: false); michael@0: } michael@0: michael@0: void WaitForNotification() michael@0: { michael@0: while (mVisits < mExpectedVisits) { michael@0: (void)NS_ProcessNextEvent(); michael@0: } michael@0: } michael@0: michael@0: NS_IMETHOD Observe(nsISupports* aSubject, michael@0: const char* aTopic, michael@0: const char16_t* aData) michael@0: { michael@0: mVisits++; michael@0: michael@0: if (mVisits == mExpectedVisits) { michael@0: nsCOMPtr observerService = michael@0: do_GetService(NS_OBSERVERSERVICE_CONTRACTID); michael@0: (void)observerService->RemoveObserver(this, "uri-visit-saved"); michael@0: } michael@0: michael@0: return NS_OK; michael@0: } michael@0: private: michael@0: int mVisits; michael@0: int mExpectedVisits; michael@0: }; michael@0: NS_IMPL_ISUPPORTS( michael@0: VisitURIObserver, michael@0: nsIObserver michael@0: ) michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: //// Test Functions michael@0: michael@0: void michael@0: test_set_places_enabled() michael@0: { michael@0: // Ensure places is enabled for everyone. michael@0: nsresult rv; michael@0: nsCOMPtr prefBranch = michael@0: do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); michael@0: do_check_success(rv); michael@0: michael@0: rv = prefBranch->SetBoolPref("places.history.enabled", true); michael@0: do_check_success(rv); michael@0: michael@0: // Run the next test. michael@0: run_next_test(); michael@0: } michael@0: michael@0: michael@0: void michael@0: test_wait_checkpoint() michael@0: { michael@0: // This "fake" test is here to wait for the initial WAL checkpoint we force michael@0: // after creating the database schema, since that may happen at any time, michael@0: // and cause concurrent readers to access an older checkpoint. michael@0: nsCOMPtr db = do_get_db(); michael@0: nsCOMPtr stmt; michael@0: db->CreateAsyncStatement(NS_LITERAL_CSTRING("SELECT 1"), michael@0: getter_AddRefs(stmt)); michael@0: nsRefPtr spinner = new AsyncStatementSpinner(); michael@0: nsCOMPtr pending; michael@0: (void)stmt->ExecuteAsync(spinner, getter_AddRefs(pending)); michael@0: spinner->SpinUntilCompleted(); michael@0: michael@0: // Run the next test. michael@0: run_next_test(); michael@0: } michael@0: michael@0: // These variables are shared between part 1 and part 2 of the test. Part 2 michael@0: // sets the nsCOMPtr's to nullptr, freeing the reference. michael@0: namespace test_unvisited_does_not_notify { michael@0: nsCOMPtr testURI; michael@0: nsRefPtr testLink; michael@0: } michael@0: void michael@0: test_unvisited_does_not_notify_part1() michael@0: { michael@0: using namespace test_unvisited_does_not_notify; michael@0: michael@0: // This test is done in two parts. The first part registers for a URI that michael@0: // should not be visited. We then run another test that will also do a michael@0: // lookup and will be notified. Since requests are answered in the order they michael@0: // are requested (at least as long as the same URI isn't asked for later), we michael@0: // will know that the Link was not notified. michael@0: michael@0: // First, we need a test URI. michael@0: testURI = new_test_uri(); michael@0: michael@0: // Create our test Link. michael@0: testLink = new mock_Link(expect_no_visit); michael@0: michael@0: // Now, register our Link to be notified. michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsresult rv = history->RegisterVisitedCallback(testURI, testLink); michael@0: do_check_success(rv); michael@0: michael@0: // Run the next test. michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_visited_notifies() michael@0: { michael@0: // First, we add our test URI to history. michael@0: nsCOMPtr testURI = new_test_uri(); michael@0: addURI(testURI); michael@0: michael@0: // Create our test Link. The callback function will release the reference we michael@0: // have on the Link. michael@0: nsRefPtr link = new mock_Link(expect_visit); michael@0: michael@0: // Now, register our Link to be notified. michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsresult rv = history->RegisterVisitedCallback(testURI, link); michael@0: do_check_success(rv); michael@0: michael@0: // Note: test will continue upon notification. michael@0: } michael@0: michael@0: void michael@0: test_unvisited_does_not_notify_part2() michael@0: { michael@0: using namespace test_unvisited_does_not_notify; michael@0: michael@0: // We would have had a failure at this point had the content node been told it michael@0: // was visited. Therefore, it is safe to unregister our content node. michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsresult rv = history->UnregisterVisitedCallback(testURI, testLink); michael@0: do_check_success(rv); michael@0: michael@0: // Clear the stored variables now. michael@0: testURI = nullptr; michael@0: testLink = nullptr; michael@0: michael@0: // Run the next test. michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_same_uri_notifies_both() michael@0: { michael@0: // First, we add our test URI to history. michael@0: nsCOMPtr testURI = new_test_uri(); michael@0: addURI(testURI); michael@0: michael@0: // Create our two test Links. The callback function will release the michael@0: // reference we have on the Links. Only the second Link should run the next michael@0: // test! michael@0: nsRefPtr link1 = new mock_Link(expect_visit, false); michael@0: nsRefPtr link2 = new mock_Link(expect_visit); michael@0: michael@0: // Now, register our Link to be notified. michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsresult rv = history->RegisterVisitedCallback(testURI, link1); michael@0: do_check_success(rv); michael@0: rv = history->RegisterVisitedCallback(testURI, link2); michael@0: do_check_success(rv); michael@0: michael@0: // Note: test will continue upon notification. michael@0: } michael@0: michael@0: void michael@0: test_unregistered_visited_does_not_notify() michael@0: { michael@0: // This test must have a test that has a successful notification after it. michael@0: // The Link would have been notified by now if we were buggy and notified michael@0: // unregistered Links (due to request serialization). michael@0: michael@0: nsCOMPtr testURI = new_test_uri(); michael@0: nsRefPtr link = new mock_Link(expect_no_visit); michael@0: michael@0: // Now, register our Link to be notified. michael@0: nsCOMPtr history(do_get_IHistory()); michael@0: nsresult rv = history->RegisterVisitedCallback(testURI, link); michael@0: do_check_success(rv); michael@0: michael@0: // Unregister the Link. michael@0: rv = history->UnregisterVisitedCallback(testURI, link); michael@0: do_check_success(rv); michael@0: michael@0: // And finally add a visit for the URI. michael@0: addURI(testURI); michael@0: michael@0: // If history tries to notify us, we'll either crash because the Link will michael@0: // have been deleted (we are the only thing holding a reference to it), or our michael@0: // expect_no_visit call back will produce a failure. Either way, the test michael@0: // will be reported as a failure. michael@0: michael@0: // Run the next test. michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_new_visit_notifies_waiting_Link() michael@0: { michael@0: // Create our test Link. The callback function will release the reference we michael@0: // have on the link. michael@0: nsRefPtr link = new mock_Link(expect_visit); michael@0: michael@0: // Now, register our content node to be notified. michael@0: nsCOMPtr testURI = new_test_uri(); michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsresult rv = history->RegisterVisitedCallback(testURI, link); michael@0: do_check_success(rv); michael@0: michael@0: // Add ourselves to history. michael@0: addURI(testURI); michael@0: michael@0: // Note: test will continue upon notification. michael@0: } michael@0: michael@0: void michael@0: test_RegisterVisitedCallback_returns_before_notifying() michael@0: { michael@0: // Add a URI so that it's already in history. michael@0: nsCOMPtr testURI = new_test_uri(); michael@0: addURI(testURI); michael@0: michael@0: // Create our test Link. michael@0: nsRefPtr link = new mock_Link(expect_no_visit); michael@0: michael@0: // Now, register our content node to be notified. It should not be notified. michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsresult rv = history->RegisterVisitedCallback(testURI, link); michael@0: do_check_success(rv); michael@0: michael@0: // Remove ourselves as an observer. We would have failed if we had been michael@0: // notified. michael@0: rv = history->UnregisterVisitedCallback(testURI, link); michael@0: do_check_success(rv); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: namespace test_observer_topic_dispatched_helpers { michael@0: #define URI_VISITED "visited" michael@0: #define URI_NOT_VISITED "not visited" michael@0: #define URI_VISITED_RESOLUTION_TOPIC "visited-status-resolution" michael@0: class statusObserver MOZ_FINAL : public nsIObserver michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: statusObserver(nsIURI* aURI, michael@0: const bool aExpectVisit, michael@0: bool& _notified) michael@0: : mURI(aURI) michael@0: , mExpectVisit(aExpectVisit) michael@0: , mNotified(_notified) michael@0: { michael@0: nsCOMPtr observerService = michael@0: do_GetService(NS_OBSERVERSERVICE_CONTRACTID); michael@0: do_check_true(observerService); michael@0: (void)observerService->AddObserver(this, michael@0: URI_VISITED_RESOLUTION_TOPIC, michael@0: false); michael@0: } michael@0: michael@0: NS_IMETHOD Observe(nsISupports* aSubject, michael@0: const char* aTopic, michael@0: const char16_t* aData) michael@0: { michael@0: // Make sure we got notified of the right topic. michael@0: do_check_false(strcmp(aTopic, URI_VISITED_RESOLUTION_TOPIC)); michael@0: michael@0: // If this isn't for our URI, do not do anything. michael@0: nsCOMPtr notifiedURI = do_QueryInterface(aSubject); michael@0: do_check_true(notifiedURI); michael@0: michael@0: bool isOurURI; michael@0: nsresult rv = notifiedURI->Equals(mURI, &isOurURI); michael@0: do_check_success(rv); michael@0: if (!isOurURI) { michael@0: return NS_OK; michael@0: } michael@0: michael@0: // Check that we have either the visited or not visited string. michael@0: bool visited = !!NS_LITERAL_STRING(URI_VISITED).Equals(aData); michael@0: bool notVisited = !!NS_LITERAL_STRING(URI_NOT_VISITED).Equals(aData); michael@0: do_check_true(visited || notVisited); michael@0: michael@0: // Check to make sure we got the state we expected. michael@0: do_check_eq(visited, mExpectVisit); michael@0: michael@0: // Indicate that we've been notified. michael@0: mNotified = true; michael@0: michael@0: // Remove ourselves as an observer. michael@0: nsCOMPtr observerService = michael@0: do_GetService(NS_OBSERVERSERVICE_CONTRACTID); michael@0: (void)observerService->RemoveObserver(this, michael@0: URI_VISITED_RESOLUTION_TOPIC); michael@0: return NS_OK; michael@0: } michael@0: private: michael@0: nsCOMPtr mURI; michael@0: const bool mExpectVisit; michael@0: bool& mNotified; michael@0: }; michael@0: NS_IMPL_ISUPPORTS( michael@0: statusObserver, michael@0: nsIObserver michael@0: ) michael@0: } michael@0: void michael@0: test_observer_topic_dispatched() michael@0: { michael@0: using namespace test_observer_topic_dispatched_helpers; michael@0: michael@0: // Create two URIs, making sure only one is in history. michael@0: nsCOMPtr visitedURI = new_test_uri(); michael@0: nsCOMPtr notVisitedURI = new_test_uri(); michael@0: bool urisEqual; michael@0: nsresult rv = visitedURI->Equals(notVisitedURI, &urisEqual); michael@0: do_check_success(rv); michael@0: do_check_false(urisEqual); michael@0: addURI(visitedURI); michael@0: michael@0: // Need two Link objects as well - one for each URI. michael@0: nsRefPtr visitedLink = new mock_Link(expect_visit, false); michael@0: nsRefPtr visitedLinkCopy = visitedLink; michael@0: nsRefPtr notVisitedLink = new mock_Link(expect_no_visit); michael@0: michael@0: // Add the right observers for the URIs to check results. michael@0: bool visitedNotified = false; michael@0: nsCOMPtr visitedObs = michael@0: new statusObserver(visitedURI, true, visitedNotified); michael@0: bool notVisitedNotified = false; michael@0: nsCOMPtr unvisitedObs = michael@0: new statusObserver(notVisitedURI, false, notVisitedNotified); michael@0: michael@0: // Register our Links to be notified. michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: rv = history->RegisterVisitedCallback(visitedURI, visitedLink); michael@0: do_check_success(rv); michael@0: rv = history->RegisterVisitedCallback(notVisitedURI, notVisitedLink); michael@0: do_check_success(rv); michael@0: michael@0: // Spin the event loop as long as we have not been properly notified. michael@0: while (!visitedNotified || !notVisitedNotified) { michael@0: (void)NS_ProcessNextEvent(); michael@0: } michael@0: michael@0: // Unregister our observer that would not have been released. michael@0: rv = history->UnregisterVisitedCallback(notVisitedURI, notVisitedLink); michael@0: do_check_success(rv); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_visituri_inserts() michael@0: { michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsCOMPtr lastURI = new_test_uri(); michael@0: nsCOMPtr visitedURI = new_test_uri(); michael@0: michael@0: history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); michael@0: michael@0: nsRefPtr finisher = new VisitURIObserver(); michael@0: finisher->WaitForNotification(); michael@0: michael@0: PlaceRecord place; michael@0: do_get_place(visitedURI, place); michael@0: michael@0: do_check_true(place.id > 0); michael@0: do_check_false(place.hidden); michael@0: do_check_false(place.typed); michael@0: do_check_eq(place.visitCount, 1); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_visituri_updates() michael@0: { michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsCOMPtr lastURI = new_test_uri(); michael@0: nsCOMPtr visitedURI = new_test_uri(); michael@0: nsRefPtr finisher; michael@0: michael@0: history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); michael@0: finisher = new VisitURIObserver(); michael@0: finisher->WaitForNotification(); michael@0: michael@0: history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); michael@0: finisher = new VisitURIObserver(); michael@0: finisher->WaitForNotification(); michael@0: michael@0: PlaceRecord place; michael@0: do_get_place(visitedURI, place); michael@0: michael@0: do_check_eq(place.visitCount, 2); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_visituri_preserves_shown_and_typed() michael@0: { michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsCOMPtr lastURI = new_test_uri(); michael@0: nsCOMPtr visitedURI = new_test_uri(); michael@0: michael@0: history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); michael@0: // this simulates the uri visit happening in a frame. Normally frame michael@0: // transitions would be hidden unless it was previously loaded top-level michael@0: history->VisitURI(visitedURI, lastURI, 0); michael@0: michael@0: nsRefPtr finisher = new VisitURIObserver(2); michael@0: finisher->WaitForNotification(); michael@0: michael@0: PlaceRecord place; michael@0: do_get_place(visitedURI, place); michael@0: do_check_false(place.hidden); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_visituri_creates_visit() michael@0: { michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsCOMPtr lastURI = new_test_uri(); michael@0: nsCOMPtr visitedURI = new_test_uri(); michael@0: michael@0: history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); michael@0: nsRefPtr finisher = new VisitURIObserver(); michael@0: finisher->WaitForNotification(); michael@0: michael@0: PlaceRecord place; michael@0: VisitRecord visit; michael@0: do_get_place(visitedURI, place); michael@0: do_get_lastVisit(place.id, visit); michael@0: michael@0: do_check_true(visit.id > 0); michael@0: do_check_eq(visit.lastVisitId, 0); michael@0: do_check_eq(visit.transitionType, nsINavHistoryService::TRANSITION_LINK); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_visituri_transition_typed() michael@0: { michael@0: nsCOMPtr navHistory = do_get_NavHistory(); michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsCOMPtr lastURI = new_test_uri(); michael@0: nsCOMPtr visitedURI = new_test_uri(); michael@0: michael@0: navHistory->MarkPageAsTyped(visitedURI); michael@0: history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); michael@0: nsRefPtr finisher = new VisitURIObserver(); michael@0: finisher->WaitForNotification(); michael@0: michael@0: PlaceRecord place; michael@0: VisitRecord visit; michael@0: do_get_place(visitedURI, place); michael@0: do_get_lastVisit(place.id, visit); michael@0: michael@0: do_check_true(visit.transitionType == nsINavHistoryService::TRANSITION_TYPED); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_visituri_transition_embed() michael@0: { michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsCOMPtr lastURI = new_test_uri(); michael@0: nsCOMPtr visitedURI = new_test_uri(); michael@0: michael@0: history->VisitURI(visitedURI, lastURI, 0); michael@0: nsRefPtr finisher = new VisitURIObserver(); michael@0: finisher->WaitForNotification(); michael@0: michael@0: PlaceRecord place; michael@0: VisitRecord visit; michael@0: do_get_place(visitedURI, place); michael@0: do_get_lastVisit(place.id, visit); michael@0: michael@0: do_check_eq(place.id, 0); michael@0: do_check_eq(visit.id, 0); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: void michael@0: test_new_visit_adds_place_guid() michael@0: { michael@0: // First, add a visit and wait. This will also add a place. michael@0: nsCOMPtr visitedURI = new_test_uri(); michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsresult rv = history->VisitURI(visitedURI, nullptr, michael@0: mozilla::IHistory::TOP_LEVEL); michael@0: do_check_success(rv); michael@0: nsRefPtr finisher = new VisitURIObserver(); michael@0: finisher->WaitForNotification(); michael@0: michael@0: // Check that we have a guid for our visit. michael@0: PlaceRecord place; michael@0: do_get_place(visitedURI, place); michael@0: do_check_eq(place.visitCount, 1); michael@0: do_check_eq(place.guid.Length(), 12); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: //// IPC-only Tests michael@0: michael@0: void michael@0: test_two_null_links_same_uri() michael@0: { michael@0: // Tests that we do not crash when we have had two nullptr Links passed to michael@0: // RegisterVisitedCallback and then the visit occurs (bug 607469). This only michael@0: // happens in IPC builds. michael@0: nsCOMPtr testURI = new_test_uri(); michael@0: michael@0: nsCOMPtr history = do_get_IHistory(); michael@0: nsresult rv = history->RegisterVisitedCallback(testURI, nullptr); michael@0: do_check_success(rv); michael@0: rv = history->RegisterVisitedCallback(testURI, nullptr); michael@0: do_check_success(rv); michael@0: michael@0: rv = history->VisitURI(testURI, nullptr, mozilla::IHistory::TOP_LEVEL); michael@0: do_check_success(rv); michael@0: michael@0: nsRefPtr finisher = new VisitURIObserver(); michael@0: finisher->WaitForNotification(); michael@0: michael@0: run_next_test(); michael@0: } michael@0: michael@0: //////////////////////////////////////////////////////////////////////////////// michael@0: //// Test Harness michael@0: michael@0: /** michael@0: * Note: for tests marked "Order Important!", please see the test for details. michael@0: */ michael@0: Test gTests[] = { michael@0: TEST(test_set_places_enabled), // Must come first! michael@0: TEST(test_wait_checkpoint), // Must come second! michael@0: TEST(test_unvisited_does_not_notify_part1), // Order Important! michael@0: TEST(test_visited_notifies), michael@0: TEST(test_unvisited_does_not_notify_part2), // Order Important! michael@0: TEST(test_same_uri_notifies_both), michael@0: TEST(test_unregistered_visited_does_not_notify), // Order Important! michael@0: TEST(test_new_visit_notifies_waiting_Link), michael@0: TEST(test_RegisterVisitedCallback_returns_before_notifying), michael@0: TEST(test_observer_topic_dispatched), michael@0: TEST(test_visituri_inserts), michael@0: TEST(test_visituri_updates), michael@0: TEST(test_visituri_preserves_shown_and_typed), michael@0: TEST(test_visituri_creates_visit), michael@0: TEST(test_visituri_transition_typed), michael@0: TEST(test_visituri_transition_embed), michael@0: TEST(test_new_visit_adds_place_guid), michael@0: michael@0: // The rest of these tests are tests that are only run in IPC builds. michael@0: TEST(test_two_null_links_same_uri), michael@0: }; michael@0: michael@0: const char* file = __FILE__; michael@0: #define TEST_NAME "IHistory" michael@0: #define TEST_FILE file michael@0: #include "places_test_harness_tail.h"