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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 640023004: cc: Make OutputSurface::SwapBuffers pure virtual (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@latinfo
Patch Set: and rebase Created 6 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_impl_unittest.cc
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 2fc8fff4793976ce564716670828b49a6dc262fa..f0bfeed67c7655009f38986fed91b065d86b54c3 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -4395,8 +4395,9 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
context_provider->BindToCurrentThread();
context_provider->TestContext3d()->set_have_post_sub_buffer(true);
- scoped_ptr<OutputSurface> output_surface(
+ scoped_ptr<FakeOutputSurface> output_surface(
FakeOutputSurface::Create3d(context_provider));
+ FakeOutputSurface* fake_output_surface = output_surface.get();
// This test creates its own LayerTreeHostImpl, so
// that we can force partial swap enabled.
@@ -4435,8 +4436,9 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
layer_tree_host_impl->DrawLayers(&frame, gfx::FrameTime::Now());
layer_tree_host_impl->DidDrawAllLayers(frame);
layer_tree_host_impl->SwapBuffers(frame);
- EXPECT_EQ(TestContextSupport::SWAP,
- context_provider->support()->last_swap_type());
+ gfx::Rect expected_swap_rect(0, 0, 500, 500);
+ EXPECT_EQ(expected_swap_rect.ToString(),
+ fake_output_surface->last_swap_rect().ToString());
// Second frame, only the damaged area should get swapped. Damage should be
// the union of old and new child rects.
@@ -4452,12 +4454,9 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
// Make sure that partial swap is constrained to the viewport dimensions
// expected damage rect: gfx::Rect(500, 500);
// expected swap rect: flipped damage rect, but also clamped to viewport
- EXPECT_EQ(TestContextSupport::PARTIAL_SWAP,
- context_provider->support()->last_swap_type());
- gfx::Rect expected_swap_rect(0, 500-28, 26, 28);
+ expected_swap_rect = gfx::Rect(0, 500-28, 26, 28);
EXPECT_EQ(expected_swap_rect.ToString(),
- context_provider->support()->
- last_partial_swap_rect().ToString());
+ fake_output_surface->last_swap_rect().ToString());
layer_tree_host_impl->SetViewportSize(gfx::Size(10, 10));
// This will damage everything.
@@ -4468,8 +4467,9 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
host_impl_->DidDrawAllLayers(frame);
layer_tree_host_impl->SwapBuffers(frame);
- EXPECT_EQ(TestContextSupport::SWAP,
- context_provider->support()->last_swap_type());
+ expected_swap_rect = gfx::Rect(0, 0, 10, 10);
+ EXPECT_EQ(expected_swap_rect.ToString(),
+ fake_output_surface->last_swap_rect().ToString());
}
TEST_F(LayerTreeHostImplTest, RootLayerDoesntCreateExtraSurface) {

Powered by Google App Engine
This is Rietveld 408576698