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

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

Issue 267783004: Refactoring the way begin frame sources inside scheduler work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Very minor fixes. Created 6 years, 2 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 | Annotate | Revision Log
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 #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 11 matching lines...) Expand all
22 } 22 }
23 23
24 BeginFrameArgs CreateBeginFrameArgsForTesting(int64 frame_time, 24 BeginFrameArgs CreateBeginFrameArgsForTesting(int64 frame_time,
25 int64 deadline, 25 int64 deadline,
26 int64 interval) { 26 int64 interval) {
27 return BeginFrameArgs::Create(base::TimeTicks::FromInternalValue(frame_time), 27 return BeginFrameArgs::Create(base::TimeTicks::FromInternalValue(frame_time),
28 base::TimeTicks::FromInternalValue(deadline), 28 base::TimeTicks::FromInternalValue(deadline),
29 base::TimeDelta::FromInternalValue(interval)); 29 base::TimeDelta::FromInternalValue(interval));
30 } 30 }
31 31
32 BeginFrameArgs CreateTypedBeginFrameArgsForTesting(
33 int64 frame_time,
34 int64 deadline,
35 int64 interval,
36 BeginFrameArgs::BeginFrameArgsType type) {
37 return BeginFrameArgs::CreateTyped(
38 base::TimeTicks::FromInternalValue(frame_time),
39 base::TimeTicks::FromInternalValue(deadline),
40 base::TimeDelta::FromInternalValue(interval),
41 type);
42 }
43
32 BeginFrameArgs CreateExpiredBeginFrameArgsForTesting() { 44 BeginFrameArgs CreateExpiredBeginFrameArgsForTesting() {
33 base::TimeTicks now = gfx::FrameTime::Now(); 45 base::TimeTicks now = gfx::FrameTime::Now();
34 return BeginFrameArgs::Create(now, 46 return BeginFrameArgs::Create(now,
35 now - BeginFrameArgs::DefaultInterval(), 47 now - BeginFrameArgs::DefaultInterval(),
36 BeginFrameArgs::DefaultInterval()); 48 BeginFrameArgs::DefaultInterval());
37 } 49 }
38 50
39 BeginFrameArgs CreateBeginFrameArgsForTesting( 51 BeginFrameArgs CreateBeginFrameArgsForTesting(
40 scoped_refptr<TestNowSource> now_src) { 52 scoped_refptr<TestNowSource> now_src) {
41 base::TimeTicks now = now_src->Now(); 53 base::TimeTicks now = now_src->Now();
(...skipping 20 matching lines...) Expand all
62 return os; 74 return os;
63 } 75 }
64 76
65 void PrintTo(const BeginFrameArgs& args, ::std::ostream* os) { 77 void PrintTo(const BeginFrameArgs& args, ::std::ostream* os) {
66 *os << "BeginFrameArgs(" << args.frame_time.ToInternalValue() << ", " 78 *os << "BeginFrameArgs(" << args.frame_time.ToInternalValue() << ", "
67 << args.deadline.ToInternalValue() << ", " 79 << args.deadline.ToInternalValue() << ", "
68 << args.interval.InMicroseconds() << "us)"; 80 << args.interval.InMicroseconds() << "us)";
69 } 81 }
70 82
71 } // namespace cc 83 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698