| 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 "content/browser/compositor/software_browser_compositor_output_surface.
h" | 5 #include "content/browser/compositor/software_browser_compositor_output_surface.
h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 output_surface_.reset(); | 102 output_surface_.reset(); |
| 103 compositor_.reset(); | 103 compositor_.reset(); |
| 104 ui::TerminateContextFactoryForTests(); | 104 ui::TerminateContextFactoryForTests(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 scoped_ptr<content::BrowserCompositorOutputSurface> | 107 scoped_ptr<content::BrowserCompositorOutputSurface> |
| 108 SoftwareBrowserCompositorOutputSurfaceTest::CreateSurface( | 108 SoftwareBrowserCompositorOutputSurfaceTest::CreateSurface( |
| 109 scoped_ptr<cc::SoftwareOutputDevice> device) { | 109 scoped_ptr<cc::SoftwareOutputDevice> device) { |
| 110 return scoped_ptr<content::BrowserCompositorOutputSurface>( | 110 return scoped_ptr<content::BrowserCompositorOutputSurface>( |
| 111 new content::SoftwareBrowserCompositorOutputSurface( | 111 new content::SoftwareBrowserCompositorOutputSurface( |
| 112 std::move(device), compositor_->vsync_manager())); | 112 std::move(device), compositor_->vsync_manager(), |
| 113 message_loop_->task_runner().get())); |
| 113 } | 114 } |
| 114 | 115 |
| 115 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, NoVSyncProvider) { | 116 TEST_F(SoftwareBrowserCompositorOutputSurfaceTest, NoVSyncProvider) { |
| 116 cc::FakeOutputSurfaceClient output_surface_client; | 117 cc::FakeOutputSurfaceClient output_surface_client; |
| 117 scoped_ptr<cc::SoftwareOutputDevice> software_device( | 118 scoped_ptr<cc::SoftwareOutputDevice> software_device( |
| 118 new cc::SoftwareOutputDevice()); | 119 new cc::SoftwareOutputDevice()); |
| 119 output_surface_ = CreateSurface(std::move(software_device)); | 120 output_surface_ = CreateSurface(std::move(software_device)); |
| 120 CHECK(output_surface_->BindToClient(&output_surface_client)); | 121 CHECK(output_surface_->BindToClient(&output_surface_client)); |
| 121 | 122 |
| 122 cc::CompositorFrame frame; | 123 cc::CompositorFrame frame; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 136 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( | 137 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( |
| 137 output_surface_->software_device()->GetVSyncProvider()); | 138 output_surface_->software_device()->GetVSyncProvider()); |
| 138 EXPECT_EQ(0, vsync_provider->call_count()); | 139 EXPECT_EQ(0, vsync_provider->call_count()); |
| 139 | 140 |
| 140 cc::CompositorFrame frame; | 141 cc::CompositorFrame frame; |
| 141 output_surface_->SwapBuffers(&frame); | 142 output_surface_->SwapBuffers(&frame); |
| 142 | 143 |
| 143 EXPECT_EQ(1, output_surface_client.swap_count()); | 144 EXPECT_EQ(1, output_surface_client.swap_count()); |
| 144 EXPECT_EQ(1, vsync_provider->call_count()); | 145 EXPECT_EQ(1, vsync_provider->call_count()); |
| 145 } | 146 } |
| OLD | NEW |