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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_unittest.cc

Issue 1389133002: content: Use type-parameterized tests for GpuMemoryBuffer implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add blankline Created 5 years, 2 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
Index: content/common/gpu/gpu_memory_buffer_factory_unittest.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_unittest.cc b/content/common/gpu/gpu_memory_buffer_factory_unittest.cc
deleted file mode 100644
index dbd9b7602e0cf59aa3f82bb7dd1693e60e1aea8f..0000000000000000000000000000000000000000
--- a/content/common/gpu/gpu_memory_buffer_factory_unittest.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2014 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 "content/common/gpu/gpu_memory_buffer_factory.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace content {
-namespace {
-
-class GpuMemoryBufferFactoryTest
- : public testing::TestWithParam<gfx::GpuMemoryBufferType> {
- public:
- GpuMemoryBufferFactoryTest() : factory_(nullptr) {}
-
- // Overridden from testing::Test:
- void SetUp() override {
- factory_ = GpuMemoryBufferFactory::Create(GetParam());
- factory_->GetSupportedGpuMemoryBufferConfigurations(
- &supported_configurations_);
- }
- void TearDown() override { factory_.reset(); }
-
- protected:
- scoped_ptr<GpuMemoryBufferFactory> factory_;
- std::vector<GpuMemoryBufferFactory::Configuration> supported_configurations_;
-};
-
-TEST_P(GpuMemoryBufferFactoryTest, CreateAndDestroy) {
- const gfx::GpuMemoryBufferId kBufferId(1);
- const int kClientId = 1;
-
- gfx::Size buffer_size(2, 2);
-
- for (auto configuration : supported_configurations_) {
- gfx::GpuMemoryBufferHandle handle = factory_->CreateGpuMemoryBuffer(
- kBufferId, buffer_size, configuration.format, configuration.usage,
- kClientId, gfx::kNullPluginWindow);
- EXPECT_EQ(handle.type, GetParam());
- factory_->DestroyGpuMemoryBuffer(kBufferId, kClientId);
- }
-}
-
-std::vector<gfx::GpuMemoryBufferType>
-GetSupportedGpuMemoryBufferFactoryTypes() {
- std::vector<gfx::GpuMemoryBufferType> supported_types;
- GpuMemoryBufferFactory::GetSupportedTypes(&supported_types);
- return supported_types;
-}
-
-INSTANTIATE_TEST_CASE_P(
- GpuMemoryBufferFactoryTests,
- GpuMemoryBufferFactoryTest,
- ::testing::ValuesIn(GetSupportedGpuMemoryBufferFactoryTypes()));
-
-} // namespace
-} // namespace content
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_surface_texture_unittest.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698