#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/service_worker_context.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/service_worker_test_helpers.h"
#include "extensions/browser/background_script_executor.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_event_histogram_value.h"
#include "extensions/browser/service_worker/service_worker_task_queue.h"
#include "extensions/browser/service_worker/service_worker_test_utils.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_id.h"
#include "extensions/test/extension_background_page_waiter.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/test_extension_dir.h"
#include "net/dns/mock_host_resolver.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
namespace {
ContextType;
EventMetricsBrowserTest;
TestServiceWorkerTaskQueueObserver;
TestServiceWorkerContextObserver;
#if defined(ADDRESS_SANITIZER)
#define MAYBE_DispatchMetricTest …
#else
#define MAYBE_DispatchMetricTest …
#endif
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest, MAYBE_DispatchMetricTest) { … }
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest,
PersistentBackgroundDispatchMetricTest) { … }
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest,
PersistentBackgroundStaleEventsMetricTest) { … }
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest, ExternalRequestMetrics) { … }
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest,
EventPageDispatchToAckTimeActive) { … }
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest,
EventPageDispatchToAckTimeInactive) { … }
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest,
ServiceWorkerDispatchToAckTimeActive) { … }
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest,
ServiceWorkerDispatchToAckTimeInactive) { … }
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest,
DISABLED_ServiceWorkerLateEventAckMetricTest) { … }
IN_PROC_BROWSER_TEST_F(EventMetricsBrowserTest,
ServiceWorkerRedundantStartCountTest) { … }
class EventMetricsDispatchToSenderBrowserTest
: public ExtensionBrowserTest,
public testing::WithParamInterface<ContextType> { … };
IN_PROC_BROWSER_TEST_P(EventMetricsDispatchToSenderBrowserTest,
DispatchToSenderMetricTest) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
class LazyBackgroundEventMetricsApiTest : public ExtensionApiTest { … };
IN_PROC_BROWSER_TEST_F(
LazyBackgroundEventMetricsApiTest,
ContextsOutsideLazyBackgroundDoNotEmitBackgroundContextMetrics) { … }
}
}