OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/gl/gl_context.h" | 8 #include "ui/gl/gl_context.h" |
9 #include "ui/gl/gl_gl_api_implementation.h" | 9 #include "ui/gl/gl_gl_api_implementation.h" |
10 #include "ui/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
11 #include "ui/gl/gl_switches.h" | 11 #include "ui/gl/gl_switches.h" |
12 #include "ui/gl/gpu_timing.h" | 12 #include "ui/gl/gpu_timing.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 | 15 |
16 class GLContextFake : public GLContext { | 16 class GLContextFake : public GLContext { |
17 public: | 17 public: |
18 bool Initialize(GLSurface* compatible_surface, | 18 bool Initialize(GLSurface* compatible_surface, |
19 GpuPreference gpu_preference) override { | 19 GpuPreference gpu_preference) override { |
20 return true; | 20 return true; |
21 } | 21 } |
22 void Destroy() override {} | |
23 bool MakeCurrent(GLSurface* surface) override { return true; } | 22 bool MakeCurrent(GLSurface* surface) override { return true; } |
24 void ReleaseCurrent(GLSurface* surface) override {} | 23 void ReleaseCurrent(GLSurface* surface) override {} |
25 bool IsCurrent(GLSurface* surface) override { return true; } | 24 bool IsCurrent(GLSurface* surface) override { return true; } |
26 void* GetHandle() override { return NULL; } | 25 void* GetHandle() override { return NULL; } |
27 scoped_refptr<gfx::GPUTimingClient> CreateGPUTimingClient() override { | 26 scoped_refptr<gfx::GPUTimingClient> CreateGPUTimingClient() override { |
28 return NULL; | 27 return NULL; |
29 } | 28 } |
30 void OnSetSwapInterval(int interval) override {} | 29 void OnSetSwapInterval(int interval) override {} |
31 GLContextFake() : GLContext(NULL) {} | 30 GLContextFake() : GLContext(NULL) {} |
32 protected: | 31 protected: |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 kFakeDisabledExtensions); | 198 kFakeDisabledExtensions); |
200 InitializeAPI(&command_line); | 199 InitializeAPI(&command_line); |
201 | 200 |
202 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); | 201 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); |
203 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { | 202 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { |
204 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); | 203 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); |
205 } | 204 } |
206 } | 205 } |
207 | 206 |
208 } // namespace gfx | 207 } // namespace gfx |
OLD | NEW |