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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/scheduler/begin_frame_source.h" 5 #include "cc/scheduler/begin_frame_source.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/test/test_simple_task_runner.h" 10 #include "base/test/test_simple_task_runner.h"
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 BEGINFRAME_FROM_HERE, 0, 2, base::TimeTicks::FromInternalValue(10000)); 876 BEGINFRAME_FROM_HERE, 0, 2, base::TimeTicks::FromInternalValue(10000));
877 EXPECT_BEGIN_FRAME_ARGS_USED(*obs_, args); 877 EXPECT_BEGIN_FRAME_ARGS_USED(*obs_, args);
878 source_->OnBeginFrame(args); 878 source_->OnBeginFrame(args);
879 879
880 EXPECT_CALL((*client_), OnDidFinishFrame(BeginFrameAck(0, 2, 2, 0, false))) 880 EXPECT_CALL((*client_), OnDidFinishFrame(BeginFrameAck(0, 2, 2, 0, false)))
881 .Times(1); 881 .Times(1);
882 EXPECT_CALL((*client_), OnNeedsBeginFrames(false)).Times(1); 882 EXPECT_CALL((*client_), OnNeedsBeginFrames(false)).Times(1);
883 source_->RemoveObserver(obs_.get()); 883 source_->RemoveObserver(obs_.get());
884 } 884 }
885 885
886 // https://crbug.com/690127: Duplicate BeginFrame caused DCHECK crash.
887 TEST_F(ExternalBeginFrameSourceTest, OnBeginFrameChecksBeginFrameContinuity) {
888 EXPECT_BEGIN_FRAME_SOURCE_PAUSED(*obs_, false);
889 EXPECT_CALL((*client_), OnNeedsBeginFrames(true)).Times(1);
890 source_->AddObserver(obs_.get());
891
892 BeginFrameArgs args = CreateBeginFrameArgsForTesting(
893 BEGINFRAME_FROM_HERE, 0, 2, base::TimeTicks::FromInternalValue(10000));
894 EXPECT_BEGIN_FRAME_ARGS_USED(*obs_, args);
895 source_->OnBeginFrame(args);
896
897 // Providing same args again to OnBeginFrame() should not notify observer.
898 EXPECT_CALL((*client_), OnDidFinishFrame(BeginFrameAck(0, 2, 0, 0, false)))
899 .Times(1);
900 source_->OnBeginFrame(args);
901
902 // Providing same args through a different ExternalBeginFrameSource also does
903 // not notify observer.
904 EXPECT_BEGIN_FRAME_SOURCE_PAUSED(*obs_, false);
905 EXPECT_CALL((*client_), OnNeedsBeginFrames(true)).Times(1);
906 ExternalBeginFrameSource source2(client_.get());
907 source2.AddObserver(obs_.get());
908 source2.OnBeginFrame(args);
909 }
910
886 } // namespace 911 } // namespace
887 } // namespace cc 912 } // namespace cc
OLDNEW
« 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