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

Side by Side Diff: cc/output/begin_frame_args_unittest.cc

Issue 2833603002: Revert of Plumb activation time to main (Closed)
Patch Set: Created 3 years, 8 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 | « cc/output/begin_frame_args.cc ('k') | cc/scheduler/begin_frame_source.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 #include <string> 5 #include <string>
6 6
7 #include "cc/output/begin_frame_args.h" 7 #include "cc/output/begin_frame_args.h"
8 #include "cc/test/begin_frame_args_test.h" 8 #include "cc/test/begin_frame_args_test.h"
9 #include "testing/gtest/include/gtest/gtest-spi.h" 9 #include "testing/gtest/include/gtest/gtest-spi.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 ::testing::PrintToString(args2)); 90 ::testing::PrintToString(args2));
91 } 91 }
92 92
93 TEST(BeginFrameArgsTest, Create) { 93 TEST(BeginFrameArgsTest, Create) {
94 // BeginFrames are not valid by default 94 // BeginFrames are not valid by default
95 BeginFrameArgs args1; 95 BeginFrameArgs args1;
96 EXPECT_FALSE(args1.IsValid()) << args1; 96 EXPECT_FALSE(args1.IsValid()) << args1;
97 EXPECT_TRUE(args1.on_critical_path); 97 EXPECT_TRUE(args1.on_critical_path);
98 98
99 BeginFrameArgs args2 = BeginFrameArgs::Create( 99 BeginFrameArgs args2 = BeginFrameArgs::Create(
100 BEGINFRAME_FROM_HERE, 123, 10, BeginFrameArgs::kDefaultSourceFrameNumber, 100 BEGINFRAME_FROM_HERE, 123, 10, base::TimeTicks::FromInternalValue(1),
101 base::TimeTicks::FromInternalValue(1),
102 base::TimeTicks::FromInternalValue(2), 101 base::TimeTicks::FromInternalValue(2),
103 base::TimeDelta::FromInternalValue(3), BeginFrameArgs::NORMAL); 102 base::TimeDelta::FromInternalValue(3), BeginFrameArgs::NORMAL);
104 EXPECT_TRUE(args2.IsValid()) << args2; 103 EXPECT_TRUE(args2.IsValid()) << args2;
105 EXPECT_EQ(123u, args2.source_id) << args2; 104 EXPECT_EQ(123u, args2.source_id) << args2;
106 EXPECT_EQ(10u, args2.sequence_number) << args2; 105 EXPECT_EQ(10u, args2.sequence_number) << args2;
107 EXPECT_EQ(1, args2.frame_time.ToInternalValue()) << args2; 106 EXPECT_EQ(1, args2.frame_time.ToInternalValue()) << args2;
108 EXPECT_EQ(2, args2.deadline.ToInternalValue()) << args2; 107 EXPECT_EQ(2, args2.deadline.ToInternalValue()) << args2;
109 EXPECT_EQ(3, args2.interval.ToInternalValue()) << args2; 108 EXPECT_EQ(3, args2.interval.ToInternalValue()) << args2;
110 EXPECT_EQ(BeginFrameArgs::NORMAL, args2.type) << args2; 109 EXPECT_EQ(BeginFrameArgs::NORMAL, args2.type) << args2;
111 } 110 }
112 111
113 #ifndef NDEBUG 112 #ifndef NDEBUG
114 TEST(BeginFrameArgsTest, Location) { 113 TEST(BeginFrameArgsTest, Location) {
115 tracked_objects::Location expected_location = BEGINFRAME_FROM_HERE; 114 tracked_objects::Location expected_location = BEGINFRAME_FROM_HERE;
116 115
117 BeginFrameArgs args = CreateBeginFrameArgsForTesting(expected_location, 0, 1); 116 BeginFrameArgs args = CreateBeginFrameArgsForTesting(expected_location, 0, 1);
118 EXPECT_EQ(expected_location.ToString(), args.created_from.ToString()); 117 EXPECT_EQ(expected_location.ToString(), args.created_from.ToString());
119 } 118 }
120 #endif 119 #endif
121 120
122 } // namespace 121 } // namespace
123 } // namespace cc 122 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/begin_frame_args.cc ('k') | cc/scheduler/begin_frame_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698