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

Side by Side Diff: gpu/command_buffer/service/gpu_service_test.cc

Issue 332303002: gpu: Add base class for gpu service tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update gpu/build.GN Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "gpu/command_buffer/service/gpu_service_test.h"
6
7 #include "gpu/command_buffer/service/test_helper.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gl/gl_context_stub_with_extensions.h"
10 #include "ui/gl/gl_implementation.h"
11 #include "ui/gl/gl_mock.h"
12 #include "ui/gl/gl_surface.h"
13
14 namespace gpu {
15 namespace gles2 {
16
17 GpuServiceTest::GpuServiceTest() : ran_setup_(false), ran_teardown_(false) {
18 }
19
20 GpuServiceTest::~GpuServiceTest() {
21 DCHECK(ran_teardown_);
22 }
23
24 void GpuServiceTest::SetUp() {
25 testing::Test::SetUp();
26
27 gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress);
28 gfx::GLSurface::InitializeOneOffWithMockBindingsForTests();
29 gl_.reset(new ::testing::StrictMock< ::gfx::MockGLInterface>());
30 ::gfx::MockGLInterface::SetGLInterface(gl_.get());
31
32 context_ = new gfx::GLContextStubWithExtensions;
33 context_->AddExtensionsString(NULL);
34 context_->SetGLVersionString("3.0");
35 gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_);
36 ran_setup_ = true;
37 }
38
39 void GpuServiceTest::TearDown() {
40 DCHECK(ran_setup_);
41 ::gfx::MockGLInterface::SetGLInterface(NULL);
42 gl_.reset();
43 gfx::ClearGLBindings();
44 ran_teardown_ = true;
45
46 testing::Test::TearDown();
47 }
48
49 } // namespace gles2
50 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_service_test.h ('k') | gpu/command_buffer/service/gpu_tracer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698