chromium/media/audio/audio_thread_hang_monitor_unittest.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/audio/audio_thread_hang_monitor.h"

#include <optional>

#include "base/functional/bind.h"
#include "base/location.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

ElementsAre;
Test;
HangAction;

namespace media {

namespace {

constexpr int kStarted =;
constexpr int kHung =;
constexpr int kRecovered =;

constexpr base::TimeDelta kShortHangDeadline =;
constexpr base::TimeDelta kLongHangDeadline =;

}  // namespace

class AudioThreadHangMonitorTest : public Test {};

TEST_F(AudioThreadHangMonitorTest, LogsThreadStarted) {}

TEST_F(AudioThreadHangMonitorTest, DoesNotLogThreadHungWhenOk) {}

TEST_F(AudioThreadHangMonitorTest, LogsHungWhenAudioThreadIsBlocked) {}

TEST_F(AudioThreadHangMonitorTest, DoesNotLogThreadHungWithShortDeadline) {}

TEST_F(AudioThreadHangMonitorTest, LogsThreadHungWithShortDeadline) {}

TEST_F(AudioThreadHangMonitorTest, DoesNotLogThreadHungWithLongDeadline) {}

TEST_F(AudioThreadHangMonitorTest, LogsThreadHungWithLongDeadline) {}

// Zero deadline means that the default deadline should be used.
TEST_F(AudioThreadHangMonitorTest, ZeroDeadlineMeansDefaultDeadline) {}

TEST_F(AudioThreadHangMonitorTest,
       LogsRecoveredWhenAudioThreadIsBlockedThenRecovers) {}

TEST_F(AudioThreadHangMonitorTest, NoHangActionWhenOk) {}

TEST_F(AudioThreadHangMonitorTest, DumpsWhenAudioThreadIsBlocked) {}

TEST_F(AudioThreadHangMonitorTest, TerminatesProcessWhenAudioThreadIsBlocked) {}

TEST_F(AudioThreadHangMonitorTest,
       DumpsAndTerminatesProcessWhenAudioThreadIsBlocked) {}

}  // namespace media