chromium/media/midi/midi_manager_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "media/midi/midi_manager.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>
#include <vector>

#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/weak_ptr.h"
#include "base/system/system_monitor.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "build/build_config.h"
#include "media/midi/midi_service.h"
#include "media/midi/task_service.h"
#include "testing/gtest/include/gtest/gtest.h"

#if BUILDFLAG(IS_WIN)
#include "media/midi/midi_manager_win.h"
#endif  // BUILDFLAG(IS_WIN)

namespace midi {

namespace {

PortState;
Result;

class FakeMidiManager : public MidiManager {};

class FakeMidiManagerFactory : public MidiService::ManagerFactory {};

class FakeMidiManagerClient : public MidiManagerClient {};

class MidiManagerTest : public ::testing::Test {};

TEST_F(MidiManagerTest, StartAndEndSession) {}

TEST_F(MidiManagerTest, StartAndEndSessionWithError) {}

TEST_F(MidiManagerTest, StartMultipleSessions) {}

TEST_F(MidiManagerTest, TooManyPendingSessions) {}

TEST_F(MidiManagerTest, AbortSession) {}

class PlatformMidiManagerTest : public ::testing::Test {};

#if BUILDFLAG(IS_ANDROID)
// The test sometimes fails on Android. https://crbug.com/844027
#define MAYBE_CreatePlatformMidiManager
#else
#define MAYBE_CreatePlatformMidiManager
#endif
TEST_F(PlatformMidiManagerTest, MAYBE_CreatePlatformMidiManager) {}

TEST_F(PlatformMidiManagerTest, InstanceIdOverflow) {}

}  // namespace

}  // namespace midi