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

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

Issue 1373033004: aura: Defer OutputSurface creation until widget is available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/thread_task_runner_handle.h" 5 #include "base/thread_task_runner_handle.h"
6 #include "cc/output/compositor_frame.h" 6 #include "cc/output/compositor_frame.h"
7 #include "cc/test/fake_output_surface_client.h" 7 #include "cc/test/fake_output_surface_client.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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 SoftwareBrowserCompositorOutputSurfaceTest:: 84 SoftwareBrowserCompositorOutputSurfaceTest::
85 ~SoftwareBrowserCompositorOutputSurfaceTest() {} 85 ~SoftwareBrowserCompositorOutputSurfaceTest() {}
86 86
87 void SoftwareBrowserCompositorOutputSurfaceTest::SetUp() { 87 void SoftwareBrowserCompositorOutputSurfaceTest::SetUp() {
88 bool enable_pixel_output = false; 88 bool enable_pixel_output = false;
89 ui::ContextFactory* context_factory = 89 ui::ContextFactory* context_factory =
90 ui::InitializeContextFactoryForTests(enable_pixel_output); 90 ui::InitializeContextFactoryForTests(enable_pixel_output);
91 91
92 compositor_.reset( 92 compositor_.reset(
93 new ui::Compositor(context_factory, base::ThreadTaskRunnerHandle::Get())); 93 new ui::Compositor(context_factory, base::ThreadTaskRunnerHandle::Get()));
94 compositor_->SetAcceleratedWidgetAndStartCompositor( 94 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
95 gfx::kNullAcceleratedWidget);
96 } 95 }
97 96
98 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() { 97 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() {
99 output_surface_.reset(); 98 output_surface_.reset();
100 compositor_.reset(); 99 compositor_.reset();
101 ui::TerminateContextFactoryForTests(); 100 ui::TerminateContextFactoryForTests();
102 } 101 }
103 102
104 scoped_ptr<content::BrowserCompositorOutputSurface> 103 scoped_ptr<content::BrowserCompositorOutputSurface>
105 SoftwareBrowserCompositorOutputSurfaceTest::CreateSurface( 104 SoftwareBrowserCompositorOutputSurfaceTest::CreateSurface(
(...skipping 28 matching lines...) Expand all
134 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( 133 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>(
135 output_surface_->software_device()->GetVSyncProvider()); 134 output_surface_->software_device()->GetVSyncProvider());
136 EXPECT_EQ(0, vsync_provider->call_count()); 135 EXPECT_EQ(0, vsync_provider->call_count());
137 136
138 cc::CompositorFrame frame; 137 cc::CompositorFrame frame;
139 output_surface_->SwapBuffers(&frame); 138 output_surface_->SwapBuffers(&frame);
140 139
141 EXPECT_EQ(1, output_surface_client.swap_count()); 140 EXPECT_EQ(1, output_surface_client.swap_count());
142 EXPECT_EQ(1, vsync_provider->call_count()); 141 EXPECT_EQ(1, vsync_provider->call_count());
143 } 142 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698