chromium/gpu/ipc/client/command_buffer_proxy_impl_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 "gpu/ipc/client/command_buffer_proxy_impl.h"

#include <limits>
#include <utility>
#include <vector>

#include "base/feature_list.h"
#include "base/memory/raw_ref.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "gpu/command_buffer/client/gpu_control_client.h"
#include "gpu/command_buffer/common/context_creation_attribs.h"
#include "gpu/config/gpu_finch_features.h"
#include "gpu/ipc/client/gpu_channel_host.h"
#include "gpu/ipc/common/gpu_channel.mojom.h"
#include "gpu/ipc/common/mock_command_buffer.h"
#include "gpu/ipc/common/mock_gpu_channel.h"
#include "gpu/ipc/common/surface_handle.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

_;
Invoke;
InvokeWithoutArgs;
Matcher;
Return;

namespace gpu {
namespace {

// GpuChannelHost is expected to be created on the IO thread, and posts tasks to
// setup its IPC listener, so it must be created after the thread task runner
// handle is set.  It expects Send to be called on any thread except IO thread,
// and posts tasks to the IO thread to ensure IPCs are sent in order, which is
// important for sync IPCs.  But we override Send, so we can't test sync IPC
// behavior with this setup.
class TestGpuChannelHost : public GpuChannelHost {};

class MockGpuControlClient : public GpuControlClient {};

class CommandBufferProxyImplTest
    : public testing::WithParamInterface<std::tuple<bool, bool>>,
      public testing::Test {};

TEST_P(CommandBufferProxyImplTest, OrderingBarriersAreCoalescedWithFlush) {}

TEST_P(CommandBufferProxyImplTest, FlushPendingWorkFlushesOrderingBarriers) {}

TEST_P(CommandBufferProxyImplTest, EnsureWorkVisibleFlushesOrderingBarriers) {}

TEST_P(CommandBufferProxyImplTest,
       EnqueueDeferredMessageEnqueuesPendingOrderingBarriers) {}

TEST_P(CommandBufferProxyImplTest, CreateTransferBufferOOM) {}

INSTANTIATE_TEST_SUITE_P();
}  // namespace
}  // namespace gpu