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

Unified Diff: cc/surfaces/direct_compositor_frame_sink_unittest.cc

Issue 2785103003: [cc] CompositorFrameSinkSupport: Defer BeginFrameAck of pending frames. (Closed)
Patch Set: add comment 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/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/surface_factory.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 b725fdcc4ea42214ab16968326391ba787a4d804..e91ea2aa2e7b07d2953d75510c51c4fc82852ff8 100644
--- a/cc/surfaces/direct_compositor_frame_sink_unittest.cc
+++ b/cc/surfaces/direct_compositor_frame_sink_unittest.cc
@@ -186,10 +186,6 @@ TEST_F(DirectCompositorFrameSinkTest,
class TestBeginFrameObserver : public BeginFrameObserverBase {
public:
- explicit TestBeginFrameObserver(BeginFrameSource* source) : source_(source) {}
-
- void FinishFrame() { source_->DidFinishFrame(this, ack()); }
-
const BeginFrameAck& ack() const { return ack_; }
private:
@@ -199,9 +195,8 @@ class TestBeginFrameObserver : public BeginFrameObserverBase {
return true;
}
- void OnBeginFrameSourcePausedChanged(bool paused) override{};
+ void OnBeginFrameSourcePausedChanged(bool paused) override {}
- BeginFrameSource* source_;
BeginFrameAck ack_;
};
@@ -213,10 +208,13 @@ TEST_F(DirectCompositorFrameSinkTest, AcknowledgesBeginFramesWithDamage) {
TEST_F(DirectCompositorFrameSinkTest, AcknowledgesBeginFramesWithoutDamage) {
// Request a BeginFrame from the CompositorFrameSinkClient.
- TestBeginFrameObserver observer(begin_frame_source_.get());
+ TestBeginFrameObserver observer;
compositor_frame_sink_client_.begin_frame_source()->AddObserver(&observer);
task_runner_->RunUntilIdle();
- observer.FinishFrame();
+ EXPECT_LE(BeginFrameArgs::kStartingFrameNumber,
+ observer.ack().sequence_number);
+ compositor_frame_sink_client_.begin_frame_source()->DidFinishFrame(
+ &observer, observer.ack());
compositor_frame_sink_client_.begin_frame_source()->RemoveObserver(&observer);
// Verify that the frame sink acknowledged the last BeginFrame.
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/surface_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698