// Copyright 2019 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/command_buffer/service/multi_draw_manager.h" #include <memory> #include <tuple> #include "testing/gtest/include/gtest/gtest.h" #include "ui/gl/gl_bindings.h" namespace gpu { namespace gles2 { namespace { Param; } // namespace class MultiDrawManagerTest : public testing::TestWithParam<Param> { … }; // Test that the simple case succeeds TEST_P(MultiDrawManagerTest, Success) { … } // Test that the internal state of the multi draw manager resets such that // successive valid multi draws can be executed TEST_P(MultiDrawManagerTest, SuccessAfterSuccess) { … } // Test that multiple chunked multi draw calls succeed TEST_P(MultiDrawManagerTest, SuccessMultiple) { … } // Test that it is invalid to submit an empty multi draw TEST_P(MultiDrawManagerTest, Empty) { … } // Test that it is invalid to end a multi draw if it has not been started TEST_P(MultiDrawManagerTest, EndBeforeBegin) { … } // Test that it is invalid to begin a multi draw twice TEST_P(MultiDrawManagerTest, BeginAfterBegin) { … } // Test that it is invalid to begin a multi draw twice, even if // the first begin was empty TEST_P(MultiDrawManagerTest, BeginAfterEmptyBegin) { … } // Test that it is invalid to do a multi draw before begin TEST_P(MultiDrawManagerTest, DrawBeforeBegin) { … } // Test that it is invalid to end a multi draw twice TEST_P(MultiDrawManagerTest, DoubleEnd) { … } // Test that it is invalid to end a multi draw before the drawcount // is saturated TEST_P(MultiDrawManagerTest, Underflow) { … } // Test that it is invalid to end a multi draw before the drawcount // is saturated, using multiple chunks TEST_P(MultiDrawManagerTest, UnderflowMultiple) { … } // Test that it is invalid to do a multi draw that overflows the drawcount TEST_P(MultiDrawManagerTest, Overflow) { … } // Test that it is invalid to do a multi draw that overflows the drawcount, // using multiple chunks TEST_P(MultiDrawManagerTest, OverflowMultiple) { … } // Test that it is invalid to do a multi draw that does not match the first // chunk's draw mode TEST_P(MultiDrawManagerTest, DrawModeMismatch) { … } // Test that it is invalid to do a multi draw that does not match the first // chunk's element type TEST_P(MultiDrawManagerTest, ElementTypeMismatch) { … } INSTANTIATE_TEST_SUITE_P(…); } // namespace gles2 } // namespace gpu