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

Side by Side Diff: components/exo/surface_unittest.cc

Issue 2897053002: [cc] Remove BeginFrameAck from BFS::DidFinishFrame and update tests. (Closed)
Patch Set: sync for PrimaryBFS Created 3 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "cc/surfaces/surface.h" 5 #include "cc/surfaces/surface.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/quads/texture_draw_quad.h" 8 #include "cc/quads/texture_draw_quad.h"
9 #include "cc/surfaces/surface_manager.h" 9 #include "cc/surfaces/surface_manager.h"
10 #include "cc/test/begin_frame_args_test.h" 10 #include "cc/test/begin_frame_args_test.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // Surface should add itself as observer during 332 // Surface should add itself as observer during
333 // DidReceiveCompositorFrameAck(). 333 // DidReceiveCompositorFrameAck().
334 surface->DidReceiveCompositorFrameAck(); 334 surface->DidReceiveCompositorFrameAck();
335 EXPECT_EQ(1u, source.num_observers()); 335 EXPECT_EQ(1u, source.num_observers());
336 336
337 cc::BeginFrameArgs args(source.CreateBeginFrameArgs(BEGINFRAME_FROM_HERE)); 337 cc::BeginFrameArgs args(source.CreateBeginFrameArgs(BEGINFRAME_FROM_HERE));
338 args.frame_time = base::TimeTicks::FromInternalValue(100); 338 args.frame_time = base::TimeTicks::FromInternalValue(100);
339 source.TestOnBeginFrame(args); // Runs the frame callback. 339 source.TestOnBeginFrame(args); // Runs the frame callback.
340 EXPECT_EQ(args.frame_time, frame_time); 340 EXPECT_EQ(args.frame_time, frame_time);
341 341
342 surface->Commit(); // Acknowledges the BeginFrame. 342 surface->Commit(); // Acknowledges the BeginFrame via CompositorFrame.
343 RunAllPendingInMessageLoop(); 343 RunAllPendingInMessageLoop();
344 344
345 const cc::CompositorFrame& frame = GetFrameFromSurface(surface.get());
345 cc::BeginFrameAck expected_ack(args.source_id, args.sequence_number, 346 cc::BeginFrameAck expected_ack(args.source_id, args.sequence_number,
346 args.sequence_number, true); 347 args.sequence_number, true);
347 EXPECT_EQ(expected_ack, source.LastAckForObserver(surface.get())); 348 EXPECT_EQ(expected_ack, frame.metadata.begin_frame_ack);
348 349
349 const cc::CompositorFrame& frame = GetFrameFromSurface(surface.get()); 350 // TODO(eseckler): Add test for DidNotProduceFrame plumbing.
350 EXPECT_EQ(expected_ack, frame.metadata.begin_frame_ack);
351 } 351 }
352 352
353 } // namespace 353 } // namespace
354 } // namespace exo 354 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/surface.cc ('k') | content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698