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

Unified Diff: cc/surfaces/direct_compositor_frame_sink_unittest.cc

Issue 2755463002: [cc] Fix CompositorFrameSinkSupport BeginFrameAck interface. (Closed)
Patch Set: sync Created 3 years, 9 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
« no previous file with comments | « cc/surfaces/direct_compositor_frame_sink.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/direct_compositor_frame_sink_unittest.cc
diff --git a/cc/surfaces/direct_compositor_frame_sink_unittest.cc b/cc/surfaces/direct_compositor_frame_sink_unittest.cc
index 3bc52f1621a94e17fc062330e0baf5cf091090fe..0439ba917ffebaf4f0283d2f5a24077d233f36c7 100644
--- a/cc/surfaces/direct_compositor_frame_sink_unittest.cc
+++ b/cc/surfaces/direct_compositor_frame_sink_unittest.cc
@@ -109,6 +109,7 @@ class DirectCompositorFrameSinkTest : public testing::Test {
render_pass->SetNew(1, display_rect_, damage_rect, gfx::Transform());
CompositorFrame frame;
+ frame.metadata.begin_frame_ack = BeginFrameAck(0, 1, 1, 0, true);
frame.render_pass_list.push_back(std::move(render_pass));
compositor_frame_sink_->SubmitCompositorFrame(std::move(frame));
@@ -194,7 +195,7 @@ class TestBeginFrameObserver : public BeginFrameObserverBase {
private:
bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override {
ack_ = BeginFrameAck(args.source_id, args.sequence_number,
- args.sequence_number, 0, true);
+ args.sequence_number, 0, false);
return true;
}
@@ -204,10 +205,17 @@ class TestBeginFrameObserver : public BeginFrameObserverBase {
BeginFrameAck ack_;
};
-TEST_F(DirectCompositorFrameSinkTest, AcknowledgesBeginFrames) {
+TEST_F(DirectCompositorFrameSinkTest, AcknowledgesBeginFramesWithDamage) {
+ // Verify that the frame sink acknowledged the BeginFrame attached to
+ // CompositorFrame submitted during SetUp().
+ EXPECT_EQ(BeginFrameAck(0, 1, 1, 0, true), begin_frame_source_->last_ack());
+}
+
+TEST_F(DirectCompositorFrameSinkTest, AcknowledgesBeginFramesWithoutDamage) {
// Request a BeginFrame from the CompositorFrameSinkClient.
TestBeginFrameObserver observer(begin_frame_source_.get());
compositor_frame_sink_client_.begin_frame_source()->AddObserver(&observer);
+ task_runner_->RunUntilIdle();
observer.FinishFrame();
compositor_frame_sink_client_.begin_frame_source()->RemoveObserver(&observer);
« no previous file with comments | « cc/surfaces/direct_compositor_frame_sink.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698