OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/compositor/browser_compositor_output_surface_proxy.h" | 7 #include "content/browser/compositor/browser_compositor_output_surface_proxy.h" |
8 #include "content/browser/compositor/software_browser_compositor_output_surface.
h" | 8 #include "content/browser/compositor/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/compositor.h" | 10 #include "ui/compositor/compositor.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 SoftwareBrowserCompositorOutputSurfaceTest:: | 88 SoftwareBrowserCompositorOutputSurfaceTest:: |
89 ~SoftwareBrowserCompositorOutputSurfaceTest() {} | 89 ~SoftwareBrowserCompositorOutputSurfaceTest() {} |
90 | 90 |
91 void SoftwareBrowserCompositorOutputSurfaceTest::SetUp() { | 91 void SoftwareBrowserCompositorOutputSurfaceTest::SetUp() { |
92 bool enable_pixel_output = false; | 92 bool enable_pixel_output = false; |
93 ui::ContextFactory* context_factory = | 93 ui::ContextFactory* context_factory = |
94 ui::InitializeContextFactoryForTests(enable_pixel_output); | 94 ui::InitializeContextFactoryForTests(enable_pixel_output); |
95 | 95 |
96 compositor_.reset(new ui::Compositor(gfx::kNullAcceleratedWidget, | 96 compositor_.reset(new ui::Compositor(gfx::kNullAcceleratedWidget, |
97 context_factory)); | 97 context_factory, |
| 98 base::MessageLoopProxy::current())); |
98 surface_proxy_ = | 99 surface_proxy_ = |
99 new content::BrowserCompositorOutputSurfaceProxy(&surface_map_); | 100 new content::BrowserCompositorOutputSurfaceProxy(&surface_map_); |
100 } | 101 } |
101 | 102 |
102 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() { | 103 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() { |
103 output_surface_.reset(); | 104 output_surface_.reset(); |
104 compositor_.reset(); | 105 compositor_.reset(); |
105 | 106 |
106 EXPECT_TRUE(surface_map_.IsEmpty()); | 107 EXPECT_TRUE(surface_map_.IsEmpty()); |
107 | 108 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 140 |
140 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( | 141 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( |
141 output_surface_->software_device()->GetVSyncProvider()); | 142 output_surface_->software_device()->GetVSyncProvider()); |
142 EXPECT_EQ(0, vsync_provider->call_count()); | 143 EXPECT_EQ(0, vsync_provider->call_count()); |
143 | 144 |
144 cc::CompositorFrame frame; | 145 cc::CompositorFrame frame; |
145 output_surface_->SwapBuffers(&frame); | 146 output_surface_->SwapBuffers(&frame); |
146 | 147 |
147 EXPECT_EQ(1, vsync_provider->call_count()); | 148 EXPECT_EQ(1, vsync_provider->call_count()); |
148 } | 149 } |
OLD | NEW |