#ifdef UNSAFE_BUFFERS_BUILD
#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
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)
#define MAYBE_CreatePlatformMidiManager …
#else
#define MAYBE_CreatePlatformMidiManager …
#endif
TEST_F(PlatformMidiManagerTest, MAYBE_CreatePlatformMidiManager) { … }
TEST_F(PlatformMidiManagerTest, InstanceIdOverflow) { … }
}
}