#include "chrome/browser/notifications/scheduler/internal/impression_history_tracker.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "chrome/browser/notifications/scheduler/test/fake_clock.h"
#include "chrome/browser/notifications/scheduler/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
Invoke;
StoreEntries;
namespace notifications {
namespace {
const char kGuid1[] = …;
const char kGuid2[] = …;
const char kButtonId[] = …;
const char kTimeStr[] = …;
struct TestCase { … };
Impression CreateImpression(const base::Time& create_time,
const std::string& guid) { … }
Impression CreateImpression(const base::Time& create_time,
const std::string& guid,
UserFeedback feedback) { … }
Impression CreateImpression(
const base::Time& create_time,
const std::string& guid,
UserFeedback feedback,
base::TimeDelta ignore_timeout_duration,
Impression::ImpressionResultMap impression_mapping) { … }
TestCase CreateDefaultTestCase() { … }
class MockImpressionStore : public CollectionStore<ClientState> { … };
class MockDelegate final : public ImpressionHistoryTracker::Delegate { … };
class ImpressionHistoryTrackerTest : public ::testing::Test { … };
TEST_F(ImpressionHistoryTrackerTest, NewReigstedClient) { … }
TEST_F(ImpressionHistoryTrackerTest, DeprecateClient) { … }
TEST_F(ImpressionHistoryTrackerTest, DeleteExpiredImpression) { … }
TEST_F(ImpressionHistoryTrackerTest, AddImpression) { … }
TEST_F(ImpressionHistoryTrackerTest, GetImpressionLoadedFromDb) { … }
TEST_F(ImpressionHistoryTrackerTest, ClickNoImpression) { … }
TEST_F(ImpressionHistoryTrackerTest, ConsecutiveDismisses) { … }
TEST_F(ImpressionHistoryTrackerTest, ConsecutiveDismissesWithIgnoreTimeout) { … }
struct UserActionTestParam { … };
class ImpressionHistoryTrackerUserActionTest
: public ImpressionHistoryTrackerTest,
public ::testing::WithParamInterface<UserActionTestParam> { … };
const UserActionTestParam kUserActionTestParams[] = …;
TEST_P(ImpressionHistoryTrackerUserActionTest, UserAction) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}