diff options
author | mithro@mithis.com <mithro@mithis.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 01:50:39 +0000 |
---|---|---|
committer | mithro@mithis.com <mithro@mithis.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 01:50:39 +0000 |
commit | 390884a85bc5b0615f415ad9ad5a7b27694e4e24 (patch) | |
tree | 3743102249304fd24835edce2b8954e4fed77ac8 /cc/test/begin_frame_args_test.cc | |
parent | a7a1c83a1fab0b235777ae65a5cb864e8fd9d9f0 (diff) | |
download | chromium_src-390884a85bc5b0615f415ad9ad5a7b27694e4e24.zip chromium_src-390884a85bc5b0615f415ad9ad5a7b27694e4e24.tar.gz chromium_src-390884a85bc5b0615f415ad9ad5a7b27694e4e24.tar.bz2 |
Refactoring the debug creation of BeginFrameArgs objects to be in unittest code only.
Adding an output_test_common.xx file which will also gain more testing features
for BeginFrameArgs soon.
BUG=371223
Review URL: https://codereview.chromium.org/275543004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269474 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/begin_frame_args_test.cc')
-rw-r--r-- | cc/test/begin_frame_args_test.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cc/test/begin_frame_args_test.cc b/cc/test/begin_frame_args_test.cc new file mode 100644 index 0000000..4565a94 --- /dev/null +++ b/cc/test/begin_frame_args_test.cc @@ -0,0 +1,35 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "cc/test/begin_frame_args_test.h" + +#include "base/time/time.h" +#include "cc/output/begin_frame_args.h" +#include "ui/gfx/frame_time.h" + +namespace cc { + +BeginFrameArgs CreateBeginFrameArgsForTesting() { + base::TimeTicks now = gfx::FrameTime::Now(); + return BeginFrameArgs::Create(now, + now + (BeginFrameArgs::DefaultInterval() / 2), + BeginFrameArgs::DefaultInterval()); +} + +BeginFrameArgs CreateBeginFrameArgsForTesting(int64 frame_time, + int64 deadline, + int64 interval) { + return BeginFrameArgs::Create(base::TimeTicks::FromInternalValue(frame_time), + base::TimeTicks::FromInternalValue(deadline), + base::TimeDelta::FromInternalValue(interval)); +} + +BeginFrameArgs CreateExpiredBeginFrameArgsForTesting() { + base::TimeTicks now = gfx::FrameTime::Now(); + return BeginFrameArgs::Create(now, + now - BeginFrameArgs::DefaultInterval(), + BeginFrameArgs::DefaultInterval()); +} + +} // namespace cc |