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 <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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 EXPECT_EQ(std::string("BeginFrameArgs(NORMAL, 0, 0, -1us)"), | 70 EXPECT_EQ(std::string("BeginFrameArgs(NORMAL, 0, 0, -1us)"), |
71 ::testing::PrintToString(args1)); | 71 ::testing::PrintToString(args1)); |
72 EXPECT_EQ(std::string("BeginFrameArgs(NORMAL, 1, 2, 3us)"), | 72 EXPECT_EQ(std::string("BeginFrameArgs(NORMAL, 1, 2, 3us)"), |
73 ::testing::PrintToString(args2)); | 73 ::testing::PrintToString(args2)); |
74 } | 74 } |
75 | 75 |
76 TEST(BeginFrameArgsTest, Create) { | 76 TEST(BeginFrameArgsTest, Create) { |
77 // BeginFrames are not valid by default | 77 // BeginFrames are not valid by default |
78 BeginFrameArgs args1; | 78 BeginFrameArgs args1; |
79 EXPECT_FALSE(args1.IsValid()) << args1; | 79 EXPECT_FALSE(args1.IsValid()) << args1; |
| 80 EXPECT_TRUE(args1.on_critical_path); |
80 | 81 |
81 BeginFrameArgs args2 = BeginFrameArgs::Create( | 82 BeginFrameArgs args2 = BeginFrameArgs::Create( |
82 BEGINFRAME_FROM_HERE, base::TimeTicks::FromInternalValue(1), | 83 BEGINFRAME_FROM_HERE, base::TimeTicks::FromInternalValue(1), |
83 base::TimeTicks::FromInternalValue(2), | 84 base::TimeTicks::FromInternalValue(2), |
84 base::TimeDelta::FromInternalValue(3), BeginFrameArgs::NORMAL); | 85 base::TimeDelta::FromInternalValue(3), BeginFrameArgs::NORMAL); |
85 EXPECT_TRUE(args2.IsValid()) << args2; | 86 EXPECT_TRUE(args2.IsValid()) << args2; |
86 EXPECT_EQ(1, args2.frame_time.ToInternalValue()) << args2; | 87 EXPECT_EQ(1, args2.frame_time.ToInternalValue()) << args2; |
87 EXPECT_EQ(2, args2.deadline.ToInternalValue()) << args2; | 88 EXPECT_EQ(2, args2.deadline.ToInternalValue()) << args2; |
88 EXPECT_EQ(3, args2.interval.ToInternalValue()) << args2; | 89 EXPECT_EQ(3, args2.interval.ToInternalValue()) << args2; |
89 EXPECT_EQ(BeginFrameArgs::NORMAL, args2.type) << args2; | 90 EXPECT_EQ(BeginFrameArgs::NORMAL, args2.type) << args2; |
90 } | 91 } |
91 | 92 |
92 #ifndef NDEBUG | 93 #ifndef NDEBUG |
93 TEST(BeginFrameArgsTest, Location) { | 94 TEST(BeginFrameArgsTest, Location) { |
94 tracked_objects::Location expected_location = BEGINFRAME_FROM_HERE; | 95 tracked_objects::Location expected_location = BEGINFRAME_FROM_HERE; |
95 | 96 |
96 BeginFrameArgs args = CreateBeginFrameArgsForTesting(expected_location); | 97 BeginFrameArgs args = CreateBeginFrameArgsForTesting(expected_location); |
97 EXPECT_EQ(expected_location.ToString(), args.created_from.ToString()); | 98 EXPECT_EQ(expected_location.ToString(), args.created_from.ToString()); |
98 } | 99 } |
99 #endif | 100 #endif |
100 | 101 |
101 } // namespace | 102 } // namespace |
102 } // namespace cc | 103 } // namespace cc |
OLD | NEW |