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

Unified Diff: cc/scheduler/begin_frame_source_unittest.cc

Issue 2715493003: [cc] Add test for ExternalBFS::OnBeginFrame continuity check. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/begin_frame_source_unittest.cc
diff --git a/cc/scheduler/begin_frame_source_unittest.cc b/cc/scheduler/begin_frame_source_unittest.cc
index 3fba80b3447398bb4744fc64d2c557a54ec4d1a2..bce3439e31c0fc4e6809c7a201c156675e7a1805 100644
--- a/cc/scheduler/begin_frame_source_unittest.cc
+++ b/cc/scheduler/begin_frame_source_unittest.cc
@@ -883,5 +883,30 @@ TEST_F(ExternalBeginFrameSourceTest, CallsOnDidFinishFrameWhenObserverRemoved) {
source_->RemoveObserver(obs_.get());
}
+// https://crbug.com/690127: Duplicate BeginFrame caused DCHECK crash.
+TEST_F(ExternalBeginFrameSourceTest, OnBeginFrameChecksBeginFrameContinuity) {
+ EXPECT_BEGIN_FRAME_SOURCE_PAUSED(*obs_, false);
+ EXPECT_CALL((*client_), OnNeedsBeginFrames(true)).Times(1);
+ source_->AddObserver(obs_.get());
+
+ BeginFrameArgs args = CreateBeginFrameArgsForTesting(
+ BEGINFRAME_FROM_HERE, 0, 2, base::TimeTicks::FromInternalValue(10000));
+ EXPECT_BEGIN_FRAME_ARGS_USED(*obs_, args);
+ source_->OnBeginFrame(args);
+
+ // Providing same args again to OnBeginFrame() should not notify observer.
+ EXPECT_CALL((*client_), OnDidFinishFrame(BeginFrameAck(0, 2, 0, 0, false)))
+ .Times(1);
+ source_->OnBeginFrame(args);
+
+ // Providing same args through a different ExternalBeginFrameSource also does
+ // not notify observer.
+ EXPECT_BEGIN_FRAME_SOURCE_PAUSED(*obs_, false);
+ EXPECT_CALL((*client_), OnNeedsBeginFrames(true)).Times(1);
+ ExternalBeginFrameSource source2(client_.get());
+ source2.AddObserver(obs_.get());
+ source2.OnBeginFrame(args);
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698