#include "chrome/browser/web_applications/daily_metrics_helper.h"
#include <stdint.h>
#include <vector>
#include "base/numerics/clamped_math.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "chrome/browser/web_applications/test/web_app_test.h"
#include "chrome/test/base/testing_profile.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/test/browser_task_environment.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/mojom/ukm_interface.mojom.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace web_app {
namespace {
Contains;
Key;
Not;
UkmEntry;
constexpr auto kInstallSourceNameHash = …;
MATCHER_P3(EntryWithStartUrlAndInstallSource,
ukm_recorder,
url,
install_source,
"") { … }
class DailyMetricsHelperTest : public WebAppTest { … };
}
TEST_F(DailyMetricsHelperTest, NothingEmittedForCallsInOneDay) { … }
TEST_F(DailyMetricsHelperTest, EmitsOldRecordsOnFirstCallNextDay) { … }
TEST_F(DailyMetricsHelperTest, EmitsOncePerUrl) { … }
TEST_F(DailyMetricsHelperTest, EmitsLatestValuePerUrl) { … }
TEST_F(DailyMetricsHelperTest, EmitsLatestValues) { … }
TEST_F(DailyMetricsHelperTest, EmitsSumsForDurationsAndSessions) { … }
TEST_F(DailyMetricsHelperTest, EmitsClampedSumsForExtremeDurations) { … }
TEST_F(DailyMetricsHelperTest, DoesNotEmitZeroDurationsOrSessions) { … }
}