#include "components/media_router/browser/media_router_metrics.h"
#include <string>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/strcat.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_clock.h"
#include "base/time/time.h"
#include "components/media_router/common/media_sink.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
Bucket;
ElementsAre;
namespace media_router {
namespace {
void TestRecordTimeDeltaMetric(
base::RepeatingCallback<void(const base::TimeDelta&)> recording_cb,
const std::string& histogram_name) { … }
void TestRecordBooleanMetric(base::RepeatingCallback<void(bool)> recording_cb,
const std::string& histogram_name) { … }
void TestRouteResultCodeHistogramsWithProviders(
base::RepeatingCallback<void(mojom::RouteRequestResultCode,
std::optional<mojom::MediaRouteProviderId>)>
record_cb,
mojom::MediaRouteProviderId provider1,
const std::string& histogram_provider1,
mojom::MediaRouteProviderId provider2,
const std::string& histogram_provider2) { … }
void TestRouteResultCodeHistograms(
base::RepeatingCallback<void(mojom::RouteRequestResultCode,
std::optional<mojom::MediaRouteProviderId>)>
record_cb,
const std::string& base_histogram_name) { … }
}
TEST(MediaRouterMetricsTest, RecordMediaRouterDialogActivationLocation) { … }
TEST(MediaRouterMetricsTest, RecordMediaRouterDialogLoaded) { … }
TEST(MediaRouterMetricsTest, RecordPresentationUrlType) { … }
TEST(MediaRouterMetricsTest, RecordMediaSinkType) { … }
TEST(MediaRouterMetricsTest, RecordDeviceCount) { … }
TEST(MediaRouterMetricsTest, RecordIconStateAtDialogOpen) { … }
TEST(MediaRouterMetricsTest, RecordCreateRouteResultCode) { … }
TEST(MediaRouterMetricsTest, RecordJoinRouteResultCode) { … }
TEST(MediaRouterMetricsTest, RecordTerminateRouteResultCode) { … }
}