#ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_HISTORY_HELPER_H_
#define CHROME_BROWSER_SYNC_TEST_INTEGRATION_HISTORY_HELPER_H_
#include <map>
#include <vector>
#include "chrome/browser/sync/test/integration/fake_server_match_status_checker.h"
#include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
#include "components/history/core/browser/history_types.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace history {
void PrintTo(const VisitRow& row, std::ostream* os);
}
namespace sync_pb {
void PrintTo(const HistorySpecifics& history, std::ostream* os);
}
namespace history_helper {
MATCHER_P(UrlIs, url, "") { … }
MATCHER_P2(UrlsAre, url1, url2, "") { … }
MATCHER_P(CoreTransitionIs, transition, "") { … }
MATCHER(IsChainStart, "") { … }
MATCHER(IsChainEnd, "") { … }
MATCHER(HasReferringVisit, "") { … }
MATCHER(HasOpenerVisit, "") { … }
MATCHER(HasReferrerURL, "") { … }
MATCHER_P(ReferrerURLIs, referrer_url, "") { … }
MATCHER(HasVisitDuration, "") { … }
MATCHER(HasHttpResponseCode, "") { … }
MATCHER(StandardFieldsArePopulated, "") { … }
MATCHER_P(VisitRowIdIs, visit_id, "") { … }
MATCHER(VisitRowHasDuration, "") { … }
MATCHER_P(VisitRowDurationIs, duration, "") { … }
bool GetUrlFromClient(int index, const GURL& url, history::URLRow* row);
bool GetUrlFromClient(int index, history::URLID url_id, history::URLRow* row);
history::VisitVector GetVisitsFromClient(int index, history::URLID id);
history::VisitVector GetVisitsForURLFromClient(int index, const GURL& url);
std::vector<history::AnnotatedVisit> GetAnnotatedVisitsFromClient(
int index,
history::URLID id);
std::vector<history::AnnotatedVisit> GetAnnotatedVisitsForURLFromClient(
int index,
const GURL& url);
history::VisitVector GetRedirectChainFromClient(int index,
history::VisitRow final_visit);
void AddUrlToHistory(int index, const GURL& url);
void AddUrlToHistoryWithTransition(int index,
const GURL& url,
ui::PageTransition transition,
history::VisitSource source);
void AddUrlToHistoryWithTimestamp(int index,
const GURL& url,
ui::PageTransition transition,
history::VisitSource source,
const base::Time& timestamp);
class LocalHistoryMatchChecker : public SingleClientStatusChangeChecker { … };
class ServerHistoryMatchChecker
: public fake_server::FakeServerMatchStatusChecker { … };
}
#endif