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

Side by Side Diff: content/browser/compositor/software_browser_compositor_output_surface_unittest.cc

Issue 421483003: Parameterize TaskRunner used by ui::Compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@task_runner
Patch Set: Add missing includes Created 6 years, 5 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
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698