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

Side by Side Diff: cc/test/begin_frame_args_test.h

Issue 2527283003: cc: Introduce BeginFrame sequence numbers and acknowledgements.
Patch Set: Address Brian's comments. Created 4 years 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 | « cc/surfaces/display_unittest.cc ('k') | cc/test/begin_frame_args_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CC_TEST_BEGIN_FRAME_ARGS_TEST_H_ 5 #ifndef CC_TEST_BEGIN_FRAME_ARGS_TEST_H_
6 #define CC_TEST_BEGIN_FRAME_ARGS_TEST_H_ 6 #define CC_TEST_BEGIN_FRAME_ARGS_TEST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <iosfwd> 10 #include <iosfwd>
11 11
12 #include "base/test/simple_test_tick_clock.h" 12 #include "base/test/simple_test_tick_clock.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "cc/output/begin_frame_args.h" 14 #include "cc/output/begin_frame_args.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace cc { 17 namespace cc {
18 18
19 // Functions for quickly creating BeginFrameArgs 19 // Functions for quickly creating BeginFrameArgs
20 BeginFrameArgs CreateBeginFrameArgsForTesting( 20 BeginFrameArgs CreateBeginFrameArgsForTesting(
21 BeginFrameArgs::CreationLocation location); 21 BeginFrameArgs::CreationLocation location,
22 uint64_t source_id,
23 uint64_t sequence_number);
22 BeginFrameArgs CreateBeginFrameArgsForTesting( 24 BeginFrameArgs CreateBeginFrameArgsForTesting(
23 BeginFrameArgs::CreationLocation location, 25 BeginFrameArgs::CreationLocation location,
26 uint64_t source_id,
27 uint64_t sequence_number,
24 base::TimeTicks frame_time); 28 base::TimeTicks frame_time);
25 BeginFrameArgs CreateBeginFrameArgsForTesting( 29 BeginFrameArgs CreateBeginFrameArgsForTesting(
26 BeginFrameArgs::CreationLocation location, 30 BeginFrameArgs::CreationLocation location,
31 uint64_t source_id,
32 uint64_t sequence_number,
27 int64_t frame_time, 33 int64_t frame_time,
28 int64_t deadline, 34 int64_t deadline,
29 int64_t interval); 35 int64_t interval);
30 BeginFrameArgs CreateBeginFrameArgsForTesting( 36 BeginFrameArgs CreateBeginFrameArgsForTesting(
31 BeginFrameArgs::CreationLocation location, 37 BeginFrameArgs::CreationLocation location,
38 uint64_t source_id,
39 uint64_t sequence_number,
32 int64_t frame_time, 40 int64_t frame_time,
33 int64_t deadline, 41 int64_t deadline,
34 int64_t interval, 42 int64_t interval,
35 BeginFrameArgs::BeginFrameArgsType type); 43 BeginFrameArgs::BeginFrameArgsType type);
36 44
37 // Creates a BeginFrameArgs using the fake Now value stored on the 45 // Creates a BeginFrameArgs using the fake Now value stored on the
38 // OrderSimpleTaskRunner. 46 // OrderSimpleTaskRunner.
39 BeginFrameArgs CreateBeginFrameArgsForTesting( 47 BeginFrameArgs CreateBeginFrameArgsForTesting(
40 BeginFrameArgs::CreationLocation location, 48 BeginFrameArgs::CreationLocation location,
49 uint64_t source_id,
50 uint64_t sequence_number,
41 base::SimpleTestTickClock* now_src); 51 base::SimpleTestTickClock* now_src);
42 52
43 // gtest helpers -- these *must* be in the same namespace as the types they 53 // gtest helpers -- these *must* be in the same namespace as the types they
44 // operate on. 54 // operate on.
45 55
46 // Allow "EXPECT_EQ(args1, args2);" 56 // Allow "EXPECT_EQ(args1, args2);"
47 // We don't define operator!= because EXPECT_NE(args1, args2) isn't all that 57 // We don't define operator!= because EXPECT_NE(args1, args2) isn't all that
48 // sensible. 58 // sensible.
49 bool operator==(const BeginFrameArgs& lhs, const BeginFrameArgs& rhs); 59 bool operator==(const BeginFrameArgs& lhs, const BeginFrameArgs& rhs);
50 60
51 // Allow gtest to pretty print begin frame args. 61 // Allow gtest to pretty print begin frame args.
52 ::std::ostream& operator<<(::std::ostream& os, const BeginFrameArgs& args); 62 ::std::ostream& operator<<(::std::ostream& os, const BeginFrameArgs& args);
53 void PrintTo(const BeginFrameArgs& args, ::std::ostream* os); 63 void PrintTo(const BeginFrameArgs& args, ::std::ostream* os);
54 64
55 } // namespace cc 65 } // namespace cc
56 66
57 #endif // CC_TEST_BEGIN_FRAME_ARGS_TEST_H_ 67 #endif // CC_TEST_BEGIN_FRAME_ARGS_TEST_H_
OLDNEW
« no previous file with comments | « cc/surfaces/display_unittest.cc ('k') | cc/test/begin_frame_args_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698