Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1067)

Unified Diff: gpu/command_buffer/service/transform_feedback_manager_unittest.cc

Issue 1922633002: Implement TransformFeedbackManager in GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/transform_feedback_manager.cc ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/transform_feedback_manager_unittest.cc
diff --git a/gpu/command_buffer/service/transform_feedback_manager_unittest.cc b/gpu/command_buffer/service/transform_feedback_manager_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..47e879f459f123dfcd9d28209cafb76c2e2bf71b
--- /dev/null
+++ b/gpu/command_buffer/service/transform_feedback_manager_unittest.cc
@@ -0,0 +1,63 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// 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/gpu_service_test.h"
+#include "gpu/command_buffer/service/test_helper.h"
+#include "gpu/command_buffer/service/transform_feedback_manager.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gl/gl_mock.h"
+
+using ::testing::_;
+
+namespace gpu {
+namespace gles2 {
+
+namespace {
+const GLuint kTransformFeedbackClientId = 76;
+const GLuint kTransformFeedbackServiceId = 1076;
+} // anonymous
+
+class TransformFeedbackManagerTest : public GpuServiceTest {
+ public:
+ TransformFeedbackManagerTest() {
+ }
+
+ ~TransformFeedbackManagerTest() override {}
+
+ protected:
+ void SetUp() override {
+ const GLuint kMaxTransformFeedbackSeparateAttribs = 16;
+ GpuServiceTest::SetUpWithGLVersion("4.1", "");
+ manager_.reset(new TransformFeedbackManager(
+ kMaxTransformFeedbackSeparateAttribs, true));
+ }
+
+ void TearDown() override {
+ manager_.reset();
+ GpuServiceTest::TearDown();
+ }
+
+ std::unique_ptr<TransformFeedbackManager> manager_;
+};
+
+TEST_F(TransformFeedbackManagerTest, LifeTime) {
+ manager_->CreateTransformFeedback(
+ kTransformFeedbackClientId, kTransformFeedbackServiceId);
+ scoped_refptr<TransformFeedback> transform_feedback =
+ manager_->GetTransformFeedback(kTransformFeedbackClientId);
+ EXPECT_TRUE(transform_feedback.get());
+
+ manager_->RemoveTransformFeedback(kTransformFeedbackClientId);
+ EXPECT_FALSE(manager_->GetTransformFeedback(kTransformFeedbackClientId));
+
+ EXPECT_CALL(*gl_, DeleteTransformFeedbacks(1, _))
+ .Times(1)
+ .RetiresOnSaturation();
+ transform_feedback = nullptr;
+}
+
+} // namespace gles2
+} // namespace gpu
+
+
« no previous file with comments | « gpu/command_buffer/service/transform_feedback_manager.cc ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698