chromium/media/audio/audio_input_device_unittest.cc

// Copyright 2017 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_input_device.h"

#include <utility>

#include "base/memory/ptr_util.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/process/process_handle.h"
#include "base/run_loop.h"
#include "base/sync_socket.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/task_environment.h"
#include "media/base/audio_glitch_info.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

CancelableSyncSocket;
SyncSocket;
_;
DoAll;
Invoke;
InvokeWithoutArgs;

namespace media {

namespace {

const size_t kMemorySegmentCount =;

class MockAudioInputIPC : public AudioInputIPC {};

class MockCaptureCallback : public AudioCapturerSource::CaptureCallback {};

// Verifies that the capture time and glitch info passed to Capture() are
// correct.
class AssertingCaptureCallback : public AudioCapturerSource::CaptureCallback {};

}  // namespace.

class AudioInputDeviceTest
    : public ::testing::TestWithParam<AudioInputDevice::DeadStreamDetection> {};

// Regular construction.
TEST_P(AudioInputDeviceTest, Noop) {}

ACTION_P(ReportStateChange, device) {}

// Verify that we get an OnCaptureError() callback if CreateStream fails.
TEST_P(AudioInputDeviceTest, FailToCreateStream) {}

TEST_P(AudioInputDeviceTest, CreateStream) {}

TEST_P(AudioInputDeviceTest, CaptureCallback) {}

TEST_P(AudioInputDeviceTest, CaptureCallbackSocketError) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace media.