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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "cc/output/compositor_frame.h" | 6 #include "cc/output/compositor_frame.h" |
7 #include "content/browser/aura/browser_compositor_output_surface_proxy.h" | 7 #include "content/browser/aura/browser_compositor_output_surface_proxy.h" |
8 #include "content/browser/aura/software_browser_compositor_output_surface.h" | 8 #include "content/browser/aura/software_browser_compositor_output_surface.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/compositor/test/context_factories_for_test.h" | 10 #include "ui/compositor/test/context_factories_for_test.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 scoped_ptr<ui::Compositor> compositor_; | 73 scoped_ptr<ui::Compositor> compositor_; |
74 | 74 |
75 IDMap<content::BrowserCompositorOutputSurface> surface_map_; | 75 IDMap<content::BrowserCompositorOutputSurface> surface_map_; |
76 scoped_refptr<content::BrowserCompositorOutputSurfaceProxy> surface_proxy_; | 76 scoped_refptr<content::BrowserCompositorOutputSurfaceProxy> surface_proxy_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(SoftwareBrowserCompositorOutputSurfaceTest); | 78 DISALLOW_COPY_AND_ASSIGN(SoftwareBrowserCompositorOutputSurfaceTest); |
79 }; | 79 }; |
80 | 80 |
81 SoftwareBrowserCompositorOutputSurfaceTest:: | 81 SoftwareBrowserCompositorOutputSurfaceTest:: |
82 SoftwareBrowserCompositorOutputSurfaceTest() { | 82 SoftwareBrowserCompositorOutputSurfaceTest() { |
83 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); | 83 CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL)); |
84 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); | 84 message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
85 } | 85 } |
86 | 86 |
87 SoftwareBrowserCompositorOutputSurfaceTest:: | 87 SoftwareBrowserCompositorOutputSurfaceTest:: |
88 ~SoftwareBrowserCompositorOutputSurfaceTest() {} | 88 ~SoftwareBrowserCompositorOutputSurfaceTest() {} |
89 | 89 |
90 void SoftwareBrowserCompositorOutputSurfaceTest::SetUp() { | 90 void SoftwareBrowserCompositorOutputSurfaceTest::SetUp() { |
91 ui::InitializeContextFactoryForTests(false); | 91 ui::InitializeContextFactoryForTests(false); |
92 ui::Compositor::Initialize(); | 92 ui::Compositor::Initialize(); |
93 | 93 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( | 139 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( |
140 output_surface_->software_device()->GetVSyncProvider()); | 140 output_surface_->software_device()->GetVSyncProvider()); |
141 EXPECT_EQ(0, vsync_provider->call_count()); | 141 EXPECT_EQ(0, vsync_provider->call_count()); |
142 | 142 |
143 cc::CompositorFrame frame; | 143 cc::CompositorFrame frame; |
144 output_surface_->SwapBuffers(&frame); | 144 output_surface_->SwapBuffers(&frame); |
145 | 145 |
146 EXPECT_EQ(1, vsync_provider->call_count()); | 146 EXPECT_EQ(1, vsync_provider->call_count()); |
147 } | 147 } |
OLD | NEW |