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

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

Issue 273073002: Changes code using Compositor to pass in ContextFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tooltip on chromeos Created 6 years, 7 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 | Annotate | Revision Log
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // |message_loop_| is not used, but the main thread still has to exist for the 83 // |message_loop_| is not used, but the main thread still has to exist for the
84 // compositor to use. 84 // compositor to use.
85 message_loop_.reset(new base::MessageLoopForUI); 85 message_loop_.reset(new base::MessageLoopForUI);
86 } 86 }
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::InitializeContextFactoryForTests(enable_pixel_output); 93 ui::ContextFactory* context_factory =
94 ui::InitializeContextFactoryForTests(enable_pixel_output);
94 95
95 compositor_.reset(new ui::Compositor(gfx::kNullAcceleratedWidget)); 96 compositor_.reset(new ui::Compositor(gfx::kNullAcceleratedWidget,
97 context_factory));
96 surface_proxy_ = 98 surface_proxy_ =
97 new content::BrowserCompositorOutputSurfaceProxy(&surface_map_); 99 new content::BrowserCompositorOutputSurfaceProxy(&surface_map_);
98 } 100 }
99 101
100 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() { 102 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() {
101 output_surface_.reset(); 103 output_surface_.reset();
102 compositor_.reset(); 104 compositor_.reset();
103 105
104 EXPECT_TRUE(surface_map_.IsEmpty()); 106 EXPECT_TRUE(surface_map_.IsEmpty());
105 107
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 139
138 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( 140 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>(
139 output_surface_->software_device()->GetVSyncProvider()); 141 output_surface_->software_device()->GetVSyncProvider());
140 EXPECT_EQ(0, vsync_provider->call_count()); 142 EXPECT_EQ(0, vsync_provider->call_count());
141 143
142 cc::CompositorFrame frame; 144 cc::CompositorFrame frame;
143 output_surface_->SwapBuffers(&frame); 145 output_surface_->SwapBuffers(&frame);
144 146
145 EXPECT_EQ(1, vsync_provider->call_count()); 147 EXPECT_EQ(1, vsync_provider->call_count());
146 } 148 }
OLDNEW
« no previous file with comments | « chrome/test/base/view_event_test_base.cc ('k') | content/browser/compositor/software_output_device_ozone_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698