| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "gpu/command_buffer/client/gl_in_process_context.h" | 13 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 13 #include "gpu/command_buffer/client/gles2_implementation.h" | 14 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 14 #include "gpu/command_buffer/client/shared_memory_limits.h" | 15 #include "gpu/command_buffer/client/shared_memory_limits.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "ui/gl/gl_surface.h" | 17 #include "ui/gl/gl_surface.h" |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 class ContextTestBase : public testing::Test { | 21 class ContextTestBase : public testing::Test { |
| 21 public: | 22 public: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 32 attributes.bind_generates_resource = false; | 33 attributes.bind_generates_resource = false; |
| 33 | 34 |
| 34 context_.reset(gpu::GLInProcessContext::Create( | 35 context_.reset(gpu::GLInProcessContext::Create( |
| 35 nullptr, /* service */ | 36 nullptr, /* service */ |
| 36 nullptr, /* surface */ | 37 nullptr, /* surface */ |
| 37 true, /* offscreen */ | 38 true, /* offscreen */ |
| 38 gfx::kNullAcceleratedWidget, /* window */ | 39 gfx::kNullAcceleratedWidget, /* window */ |
| 39 nullptr, /* share_context */ | 40 nullptr, /* share_context */ |
| 40 attributes, gpu::SharedMemoryLimits(), | 41 attributes, gpu::SharedMemoryLimits(), |
| 41 nullptr, /* gpu_memory_buffer_manager */ | 42 nullptr, /* gpu_memory_buffer_manager */ |
| 42 nullptr /* image_factory */)); | 43 nullptr, /* image_factory */ |
| 44 base::ThreadTaskRunnerHandle::Get())); |
| 43 gl_ = context_->GetImplementation(); | 45 gl_ = context_->GetImplementation(); |
| 44 context_support_ = context_->GetImplementation(); | 46 context_support_ = context_->GetImplementation(); |
| 45 } | 47 } |
| 46 | 48 |
| 47 void TearDown() override { context_.reset(NULL); } | 49 void TearDown() override { context_.reset(NULL); } |
| 48 | 50 |
| 49 protected: | 51 protected: |
| 50 gpu::gles2::GLES2Interface* gl_; | 52 gpu::gles2::GLES2Interface* gl_; |
| 51 gpu::ContextSupport* context_support_; | 53 gpu::ContextSupport* context_support_; |
| 52 | 54 |
| 53 private: | 55 private: |
| 54 std::unique_ptr<gpu::GLInProcessContext> context_; | 56 std::unique_ptr<gpu::GLInProcessContext> context_; |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 } // namespace | 59 } // namespace |
| 58 | 60 |
| 59 // Include the actual tests. | 61 // Include the actual tests. |
| 60 #define CONTEXT_TEST_F TEST_F | 62 #define CONTEXT_TEST_F TEST_F |
| 61 #include "gpu/ipc/client/gpu_context_tests.h" | 63 #include "gpu/ipc/client/gpu_context_tests.h" |
| OLD | NEW |