OLD | NEW |
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 #include "cc/test/begin_frame_args_test.h" | 5 #include "cc/test/begin_frame_args_test.h" |
6 | 6 |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "cc/output/begin_frame_args.h" | 8 #include "cc/output/begin_frame_args.h" |
9 #include "ui/gfx/frame_time.h" | 9 #include "ui/gfx/frame_time.h" |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 BeginFrameArgs CreateExpiredBeginFrameArgsForTesting( | 67 BeginFrameArgs CreateExpiredBeginFrameArgsForTesting( |
68 BeginFrameArgs::CreationLocation location, | 68 BeginFrameArgs::CreationLocation location, |
69 scoped_refptr<TestNowSource> now_src) { | 69 scoped_refptr<TestNowSource> now_src) { |
70 base::TimeTicks now = now_src->Now(); | 70 base::TimeTicks now = now_src->Now(); |
71 return BeginFrameArgs::Create( | 71 return BeginFrameArgs::Create( |
72 location, now, now - BeginFrameArgs::DefaultInterval(), | 72 location, now, now - BeginFrameArgs::DefaultInterval(), |
73 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL); | 73 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL); |
74 } | 74 } |
75 | 75 |
76 bool operator==(const BeginFrameArgs& lhs, const BeginFrameArgs& rhs) { | |
77 return (lhs.type == rhs.type) && (lhs.frame_time == rhs.frame_time) && | |
78 (lhs.deadline == rhs.deadline) && (lhs.interval == rhs.interval); | |
79 } | |
80 | |
81 ::std::ostream& operator<<(::std::ostream& os, const BeginFrameArgs& args) { | 76 ::std::ostream& operator<<(::std::ostream& os, const BeginFrameArgs& args) { |
82 PrintTo(args, &os); | 77 PrintTo(args, &os); |
83 return os; | 78 return os; |
84 } | 79 } |
85 | 80 |
86 void PrintTo(const BeginFrameArgs& args, ::std::ostream* os) { | 81 void PrintTo(const BeginFrameArgs& args, ::std::ostream* os) { |
87 *os << "BeginFrameArgs(" << BeginFrameArgs::TypeToString(args.type) << ", " | 82 *os << "BeginFrameArgs(" << BeginFrameArgs::TypeToString(args.type) << ", " |
88 << args.frame_time.ToInternalValue() << ", " | 83 << args.frame_time.ToInternalValue() << ", " |
89 << args.deadline.ToInternalValue() << ", " | 84 << args.deadline.ToInternalValue() << ", " |
90 << args.interval.InMicroseconds() << "us)"; | 85 << args.interval.InMicroseconds() << "us)"; |
91 } | 86 } |
92 | 87 |
93 } // namespace cc | 88 } // namespace cc |
OLD | NEW |