#include "components/page_info/core/page_info_history_data_source.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/i18n/time_formatting.h"
#include "base/time/time.h"
#include "components/history/core/browser/history_service.h"
#include "components/strings/grit/components_strings.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
namespace history {
class MockHistoryService : public HistoryService { … };
}
namespace page_info {
_;
Invoke;
base::Time kBase = …;
base::Time kLastVisit = …;
base::CancelableTaskTracker::TaskId ReturnVisitedNever(
const std::string& host,
base::Time begin_time,
base::Time end_time,
history::HistoryService::GetLastVisitCallback callback,
base::CancelableTaskTracker* tracker) { … }
base::CancelableTaskTracker::TaskId ReturnVisitedBase(
const std::string& host,
base::Time begin_time,
base::Time end_time,
history::HistoryService::GetLastVisitCallback callback,
base::CancelableTaskTracker* tracker) { … }
base::CancelableTaskTracker::TaskId ReturnLastVisited(
const std::string& host,
base::Time begin_time,
base::Time end_time,
history::HistoryService::GetLastVisitCallback callback,
base::CancelableTaskTracker* tracker) { … }
void CheckFormattedStringsForBaseTime(base::Time now) { … }
class PageInfoHistoryDataSourceTest : public testing::Test { … };
TEST_F(PageInfoHistoryDataSourceTest, NoHistory) { … }
TEST_F(PageInfoHistoryDataSourceTest, LastVisitedTimestamp) { … }
TEST_F(PageInfoHistoryDataSourceTest, FormatTimestampString) { … }
}