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

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

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Updated Created 4 years 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 "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/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 private: 92 private:
93 DISALLOW_COPY_AND_ASSIGN(SoftwareBrowserCompositorOutputSurfaceTest); 93 DISALLOW_COPY_AND_ASSIGN(SoftwareBrowserCompositorOutputSurfaceTest);
94 }; 94 };
95 95
96 void SoftwareBrowserCompositorOutputSurfaceTest::SetUp() { 96 void SoftwareBrowserCompositorOutputSurfaceTest::SetUp() {
97 bool enable_pixel_output = false; 97 bool enable_pixel_output = false;
98 ui::ContextFactory* context_factory = 98 ui::ContextFactory* context_factory =
99 ui::InitializeContextFactoryForTests(enable_pixel_output); 99 ui::InitializeContextFactoryForTests(enable_pixel_output);
100 100
101 compositor_.reset( 101 compositor_.reset(new ui::Compositor(context_factory, nullptr,
102 new ui::Compositor(context_factory, message_loop_.task_runner().get())); 102 message_loop_.task_runner().get()));
103 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); 103 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
104 } 104 }
105 105
106 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() { 106 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() {
107 output_surface_.reset(); 107 output_surface_.reset();
108 compositor_.reset(); 108 compositor_.reset();
109 ui::TerminateContextFactoryForTests(); 109 ui::TerminateContextFactoryForTests();
110 } 110 }
111 111
112 std::unique_ptr<content::BrowserCompositorOutputSurface> 112 std::unique_ptr<content::BrowserCompositorOutputSurface>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 output_surface_->BindToClient(&output_surface_client); 146 output_surface_->BindToClient(&output_surface_client);
147 147
148 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( 148 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>(
149 output_surface_->software_device()->GetVSyncProvider()); 149 output_surface_->software_device()->GetVSyncProvider());
150 EXPECT_EQ(0, vsync_provider->call_count()); 150 EXPECT_EQ(0, vsync_provider->call_count());
151 151
152 output_surface_->SwapBuffers(cc::OutputSurfaceFrame()); 152 output_surface_->SwapBuffers(cc::OutputSurfaceFrame());
153 EXPECT_EQ(1, vsync_provider->call_count()); 153 EXPECT_EQ(1, vsync_provider->call_count());
154 EXPECT_EQ(1, update_vsync_parameters_call_count_); 154 EXPECT_EQ(1, update_vsync_parameters_call_count_);
155 } 155 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698