chromium/media/mojo/clients/mojo_renderer_unittest.cc

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

#include <stdint.h>

#include <memory>

#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/test_message_loop.h"
#include "base/threading/platform_thread.h"
#include "base/timer/elapsed_timer.h"
#include "media/base/cdm_config.h"
#include "media/base/cdm_context.h"
#include "media/base/mock_filters.h"
#include "media/base/test_helpers.h"
#include "media/cdm/clear_key_cdm_common.h"
#include "media/cdm/default_cdm_factory.h"
#include "media/mojo/clients/mojo_renderer.h"
#include "media/mojo/common/media_type_converters.h"
#include "media/mojo/mojom/content_decryption_module.mojom.h"
#include "media/mojo/mojom/renderer.mojom.h"
#include "media/mojo/services/mojo_cdm_service.h"
#include "media/mojo/services/mojo_cdm_service_context.h"
#include "media/mojo/services/mojo_renderer_service.h"
#include "media/renderers/video_overlay_factory.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

RunCallback;
RunOnceCallback;
RunOnceClosure;
_;
DoAll;
InvokeWithoutArgs;
Return;
SaveArg;
StrictMock;

namespace media {

namespace {
const int64_t kStartPlayingTimeInMs =;

ACTION_P2(GetMediaTime, start_time, elapsed_timer) {}

void WaitFor(base::TimeDelta duration) {}
}  // namespace

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

TEST_F(MojoRendererTest, Initialize_Success) {}

TEST_F(MojoRendererTest, Initialize_Failure) {}

TEST_F(MojoRendererTest, Initialize_BeforeConnectionError) {}

TEST_F(MojoRendererTest, Initialize_AfterConnectionError) {}

TEST_F(MojoRendererTest, Flush_Success) {}

TEST_F(MojoRendererTest, Flush_ConnectionError) {}

TEST_F(MojoRendererTest, Flush_AfterConnectionError) {}

TEST_F(MojoRendererTest, SetCdm_Success) {}

TEST_F(MojoRendererTest, SetCdm_Failure) {}

TEST_F(MojoRendererTest, SetCdm_InvalidCdmId) {}

TEST_F(MojoRendererTest, SetCdm_NonExistCdmId) {}

TEST_F(MojoRendererTest, SetCdm_ReleasedCdmId) {}

TEST_F(MojoRendererTest, SetCdm_BeforeInitialize) {}

TEST_F(MojoRendererTest, SetCdm_AfterInitializeAndConnectionError) {}

TEST_F(MojoRendererTest, SetCdm_AfterConnectionErrorAndBeforeInitialize) {}

TEST_F(MojoRendererTest, SetCdm_BeforeInitializeAndConnectionError) {}

TEST_F(MojoRendererTest, StartPlayingFrom) {}

TEST_F(MojoRendererTest, GetMediaTime) {}

TEST_F(MojoRendererTest, OnBufferingStateChange) {}

TEST_F(MojoRendererTest, OnEnded) {}

// TODO(xhwang): Add tests for all RendererClient methods.

TEST_F(MojoRendererTest, Destroy_PendingInitialize) {}

TEST_F(MojoRendererTest, Destroy_PendingFlush) {}

TEST_F(MojoRendererTest, Destroy_PendingSetCdm) {}

TEST_F(MojoRendererTest, ErrorDuringPlayback) {}

TEST_F(MojoRendererTest, ErrorBeforeFlush) {}

TEST_F(MojoRendererTest, ErrorDuringFlush) {}

}  // namespace media