| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "base/trace_event/trace_event_argument.h" | 11 #include "base/trace_event/trace_event_argument.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "cc/debug/frame_timing_tracker.h" | 13 #include "cc/debug/frame_timing_tracker.h" |
| 14 #include "cc/test/fake_impl_task_runner_provider.h" | 14 #include "cc/test/fake_impl_task_runner_provider.h" |
| 15 #include "cc/test/fake_layer_tree_host_impl.h" | 15 #include "cc/test/fake_layer_tree_host_impl.h" |
| 16 #include "cc/test/test_shared_bitmap_manager.h" | 16 #include "cc/test/test_shared_bitmap_manager.h" |
| 17 #include "cc/test/test_task_graph_runner.h" | 17 #include "cc/test/test_task_graph_runner.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 namespace cc { | 20 namespace cc { |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 std::string CompositeToString( | 23 std::string CompositeToString( |
| 24 scoped_ptr<FrameTimingTracker::CompositeTimingSet> timingset) { | 24 std::unique_ptr<FrameTimingTracker::CompositeTimingSet> timingset) { |
| 25 scoped_ptr<base::trace_event::TracedValue> value( | 25 std::unique_ptr<base::trace_event::TracedValue> value( |
| 26 new base::trace_event::TracedValue()); | 26 new base::trace_event::TracedValue()); |
| 27 value->BeginArray("values"); | 27 value->BeginArray("values"); |
| 28 std::set<int> rect_ids; | 28 std::set<int> rect_ids; |
| 29 for (const auto& pair : *timingset) | 29 for (const auto& pair : *timingset) |
| 30 rect_ids.insert(pair.first); | 30 rect_ids.insert(pair.first); |
| 31 | 31 |
| 32 for (const auto& rect_id : rect_ids) { | 32 for (const auto& rect_id : rect_ids) { |
| 33 auto& events = (*timingset)[rect_id]; | 33 auto& events = (*timingset)[rect_id]; |
| 34 value->BeginDictionary(); | 34 value->BeginDictionary(); |
| 35 value->SetInteger("rect_id", rect_id); | 35 value->SetInteger("rect_id", rect_id); |
| 36 value->BeginArray("events"); | 36 value->BeginArray("events"); |
| 37 for (const auto& event : events) { | 37 for (const auto& event : events) { |
| 38 value->BeginDictionary(); | 38 value->BeginDictionary(); |
| 39 value->SetInteger("frame_id", event.frame_id); | 39 value->SetInteger("frame_id", event.frame_id); |
| 40 value->SetInteger("timestamp", event.timestamp.ToInternalValue()); | 40 value->SetInteger("timestamp", event.timestamp.ToInternalValue()); |
| 41 value->EndDictionary(); | 41 value->EndDictionary(); |
| 42 } | 42 } |
| 43 value->EndArray(); | 43 value->EndArray(); |
| 44 value->EndDictionary(); | 44 value->EndDictionary(); |
| 45 } | 45 } |
| 46 value->EndArray(); | 46 value->EndArray(); |
| 47 return value->ToString(); | 47 return value->ToString(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 std::string MainFrameToString( | 50 std::string MainFrameToString( |
| 51 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> timingset) { | 51 std::unique_ptr<FrameTimingTracker::MainFrameTimingSet> timingset) { |
| 52 scoped_ptr<base::trace_event::TracedValue> value( | 52 std::unique_ptr<base::trace_event::TracedValue> value( |
| 53 new base::trace_event::TracedValue()); | 53 new base::trace_event::TracedValue()); |
| 54 value->BeginArray("values"); | 54 value->BeginArray("values"); |
| 55 std::set<int> rect_ids; | 55 std::set<int> rect_ids; |
| 56 for (const auto& pair : *timingset) | 56 for (const auto& pair : *timingset) |
| 57 rect_ids.insert(pair.first); | 57 rect_ids.insert(pair.first); |
| 58 | 58 |
| 59 for (const auto& rect_id : rect_ids) { | 59 for (const auto& rect_id : rect_ids) { |
| 60 auto& events = (*timingset)[rect_id]; | 60 auto& events = (*timingset)[rect_id]; |
| 61 value->BeginDictionary(); | 61 value->BeginDictionary(); |
| 62 value->SetInteger("rect_id", rect_id); | 62 value->SetInteger("rect_id", rect_id); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 75 return value->ToString(); | 75 return value->ToString(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 TEST(FrameTimingTrackerTest, DefaultTrackerIsEmpty) { | 78 TEST(FrameTimingTrackerTest, DefaultTrackerIsEmpty) { |
| 79 FakeImplTaskRunnerProvider task_runner_provider; | 79 FakeImplTaskRunnerProvider task_runner_provider; |
| 80 TestSharedBitmapManager shared_bitmap_manager; | 80 TestSharedBitmapManager shared_bitmap_manager; |
| 81 TestTaskGraphRunner task_graph_runner; | 81 TestTaskGraphRunner task_graph_runner; |
| 82 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 82 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 83 &task_graph_runner); | 83 &task_graph_runner); |
| 84 | 84 |
| 85 scoped_ptr<FrameTimingTracker> tracker( | 85 std::unique_ptr<FrameTimingTracker> tracker( |
| 86 FrameTimingTracker::Create(&host_impl)); | 86 FrameTimingTracker::Create(&host_impl)); |
| 87 EXPECT_EQ("{\"values\":[]}", | 87 EXPECT_EQ("{\"values\":[]}", |
| 88 CompositeToString(tracker->GroupCompositeCountsByRectId())); | 88 CompositeToString(tracker->GroupCompositeCountsByRectId())); |
| 89 EXPECT_EQ("{\"values\":[]}", | 89 EXPECT_EQ("{\"values\":[]}", |
| 90 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); | 90 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); |
| 91 } | 91 } |
| 92 | 92 |
| 93 TEST(FrameTimingTrackerTest, NoFrameIdsIsEmpty) { | 93 TEST(FrameTimingTrackerTest, NoFrameIdsIsEmpty) { |
| 94 FakeImplTaskRunnerProvider task_runner_provider; | 94 FakeImplTaskRunnerProvider task_runner_provider; |
| 95 TestSharedBitmapManager shared_bitmap_manager; | 95 TestSharedBitmapManager shared_bitmap_manager; |
| 96 TestTaskGraphRunner task_graph_runner; | 96 TestTaskGraphRunner task_graph_runner; |
| 97 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 97 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 98 &task_graph_runner); | 98 &task_graph_runner); |
| 99 | 99 |
| 100 scoped_ptr<FrameTimingTracker> tracker( | 100 std::unique_ptr<FrameTimingTracker> tracker( |
| 101 FrameTimingTracker::Create(&host_impl)); | 101 FrameTimingTracker::Create(&host_impl)); |
| 102 std::vector<std::pair<int, int64_t>> ids; | 102 std::vector<std::pair<int, int64_t>> ids; |
| 103 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); | 103 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); |
| 104 EXPECT_EQ("{\"values\":[]}", | 104 EXPECT_EQ("{\"values\":[]}", |
| 105 CompositeToString(tracker->GroupCompositeCountsByRectId())); | 105 CompositeToString(tracker->GroupCompositeCountsByRectId())); |
| 106 } | 106 } |
| 107 | 107 |
| 108 TEST(FrameTimingTrackerTest, NoRectIdsYieldsNoMainFrameEvents) { | 108 TEST(FrameTimingTrackerTest, NoRectIdsYieldsNoMainFrameEvents) { |
| 109 FakeImplTaskRunnerProvider task_runner_provider; | 109 FakeImplTaskRunnerProvider task_runner_provider; |
| 110 TestSharedBitmapManager shared_bitmap_manager; | 110 TestSharedBitmapManager shared_bitmap_manager; |
| 111 TestTaskGraphRunner task_graph_runner; | 111 TestTaskGraphRunner task_graph_runner; |
| 112 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 112 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 113 &task_graph_runner); | 113 &task_graph_runner); |
| 114 | 114 |
| 115 scoped_ptr<FrameTimingTracker> tracker( | 115 std::unique_ptr<FrameTimingTracker> tracker( |
| 116 FrameTimingTracker::Create(&host_impl)); | 116 FrameTimingTracker::Create(&host_impl)); |
| 117 tracker->SaveMainFrameTimeStamps(std::vector<int64_t>(), | 117 tracker->SaveMainFrameTimeStamps(std::vector<int64_t>(), |
| 118 base::TimeTicks::FromInternalValue(100), | 118 base::TimeTicks::FromInternalValue(100), |
| 119 base::TimeTicks::FromInternalValue(110), 1); | 119 base::TimeTicks::FromInternalValue(110), 1); |
| 120 EXPECT_EQ("{\"values\":[]}", | 120 EXPECT_EQ("{\"values\":[]}", |
| 121 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); | 121 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); |
| 122 } | 122 } |
| 123 | 123 |
| 124 TEST(FrameTimingTrackerTest, OneFrameId) { | 124 TEST(FrameTimingTrackerTest, OneFrameId) { |
| 125 FakeImplTaskRunnerProvider task_runner_provider; | 125 FakeImplTaskRunnerProvider task_runner_provider; |
| 126 TestSharedBitmapManager shared_bitmap_manager; | 126 TestSharedBitmapManager shared_bitmap_manager; |
| 127 TestTaskGraphRunner task_graph_runner; | 127 TestTaskGraphRunner task_graph_runner; |
| 128 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 128 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 129 &task_graph_runner); | 129 &task_graph_runner); |
| 130 | 130 |
| 131 scoped_ptr<FrameTimingTracker> tracker( | 131 std::unique_ptr<FrameTimingTracker> tracker( |
| 132 FrameTimingTracker::Create(&host_impl)); | 132 FrameTimingTracker::Create(&host_impl)); |
| 133 std::vector<std::pair<int, int64_t>> ids; | 133 std::vector<std::pair<int, int64_t>> ids; |
| 134 ids.push_back(std::make_pair(1, 2)); | 134 ids.push_back(std::make_pair(1, 2)); |
| 135 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); | 135 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); |
| 136 EXPECT_EQ( | 136 EXPECT_EQ( |
| 137 "{\"values\":[{\"events\":[" | 137 "{\"values\":[{\"events\":[" |
| 138 "{\"frame_id\":1,\"timestamp\":100}],\"rect_id\":2}]}", | 138 "{\"frame_id\":1,\"timestamp\":100}],\"rect_id\":2}]}", |
| 139 CompositeToString(tracker->GroupCompositeCountsByRectId())); | 139 CompositeToString(tracker->GroupCompositeCountsByRectId())); |
| 140 } | 140 } |
| 141 | 141 |
| 142 TEST(FrameTimingTrackerTest, OneMainFrameRect) { | 142 TEST(FrameTimingTrackerTest, OneMainFrameRect) { |
| 143 FakeImplTaskRunnerProvider task_runner_provider; | 143 FakeImplTaskRunnerProvider task_runner_provider; |
| 144 TestSharedBitmapManager shared_bitmap_manager; | 144 TestSharedBitmapManager shared_bitmap_manager; |
| 145 TestTaskGraphRunner task_graph_runner; | 145 TestTaskGraphRunner task_graph_runner; |
| 146 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 146 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 147 &task_graph_runner); | 147 &task_graph_runner); |
| 148 | 148 |
| 149 scoped_ptr<FrameTimingTracker> tracker( | 149 std::unique_ptr<FrameTimingTracker> tracker( |
| 150 FrameTimingTracker::Create(&host_impl)); | 150 FrameTimingTracker::Create(&host_impl)); |
| 151 std::vector<int64_t> rect_ids; | 151 std::vector<int64_t> rect_ids; |
| 152 rect_ids.push_back(1); | 152 rect_ids.push_back(1); |
| 153 tracker->SaveMainFrameTimeStamps(rect_ids, | 153 tracker->SaveMainFrameTimeStamps(rect_ids, |
| 154 base::TimeTicks::FromInternalValue(100), | 154 base::TimeTicks::FromInternalValue(100), |
| 155 base::TimeTicks::FromInternalValue(110), 2); | 155 base::TimeTicks::FromInternalValue(110), 2); |
| 156 EXPECT_EQ( | 156 EXPECT_EQ( |
| 157 "{\"values\":[{\"events\":[" | 157 "{\"values\":[{\"events\":[" |
| 158 "{\"end_time\":110,\"frame_id\":2,\"timestamp\":100}],\"rect_id\":1}]}", | 158 "{\"end_time\":110,\"frame_id\":2,\"timestamp\":100}],\"rect_id\":1}]}", |
| 159 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); | 159 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); |
| 160 } | 160 } |
| 161 | 161 |
| 162 TEST(FrameTimingTrackerTest, UnsortedTimestampsIds) { | 162 TEST(FrameTimingTrackerTest, UnsortedTimestampsIds) { |
| 163 FakeImplTaskRunnerProvider task_runner_provider; | 163 FakeImplTaskRunnerProvider task_runner_provider; |
| 164 TestSharedBitmapManager shared_bitmap_manager; | 164 TestSharedBitmapManager shared_bitmap_manager; |
| 165 TestTaskGraphRunner task_graph_runner; | 165 TestTaskGraphRunner task_graph_runner; |
| 166 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 166 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 167 &task_graph_runner); | 167 &task_graph_runner); |
| 168 | 168 |
| 169 scoped_ptr<FrameTimingTracker> tracker( | 169 std::unique_ptr<FrameTimingTracker> tracker( |
| 170 FrameTimingTracker::Create(&host_impl)); | 170 FrameTimingTracker::Create(&host_impl)); |
| 171 std::vector<std::pair<int, int64_t>> ids; | 171 std::vector<std::pair<int, int64_t>> ids; |
| 172 ids.push_back(std::make_pair(1, 2)); | 172 ids.push_back(std::make_pair(1, 2)); |
| 173 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(200), ids); | 173 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(200), ids); |
| 174 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(400), ids); | 174 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(400), ids); |
| 175 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); | 175 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids); |
| 176 EXPECT_EQ( | 176 EXPECT_EQ( |
| 177 "{\"values\":[{\"events\":[" | 177 "{\"values\":[{\"events\":[" |
| 178 "{\"frame_id\":1,\"timestamp\":100}," | 178 "{\"frame_id\":1,\"timestamp\":100}," |
| 179 "{\"frame_id\":1,\"timestamp\":200}," | 179 "{\"frame_id\":1,\"timestamp\":200}," |
| 180 "{\"frame_id\":1,\"timestamp\":400}],\"rect_id\":2}]}", | 180 "{\"frame_id\":1,\"timestamp\":400}],\"rect_id\":2}]}", |
| 181 CompositeToString(tracker->GroupCompositeCountsByRectId())); | 181 CompositeToString(tracker->GroupCompositeCountsByRectId())); |
| 182 } | 182 } |
| 183 | 183 |
| 184 TEST(FrameTimingTrackerTest, MainFrameUnsortedTimestamps) { | 184 TEST(FrameTimingTrackerTest, MainFrameUnsortedTimestamps) { |
| 185 FakeImplTaskRunnerProvider task_runner_provider; | 185 FakeImplTaskRunnerProvider task_runner_provider; |
| 186 TestSharedBitmapManager shared_bitmap_manager; | 186 TestSharedBitmapManager shared_bitmap_manager; |
| 187 TestTaskGraphRunner task_graph_runner; | 187 TestTaskGraphRunner task_graph_runner; |
| 188 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 188 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 189 &task_graph_runner); | 189 &task_graph_runner); |
| 190 | 190 |
| 191 scoped_ptr<FrameTimingTracker> tracker( | 191 std::unique_ptr<FrameTimingTracker> tracker( |
| 192 FrameTimingTracker::Create(&host_impl)); | 192 FrameTimingTracker::Create(&host_impl)); |
| 193 std::vector<int64_t> rect_ids; | 193 std::vector<int64_t> rect_ids; |
| 194 rect_ids.push_back(2); | 194 rect_ids.push_back(2); |
| 195 tracker->SaveMainFrameTimeStamps(rect_ids, | 195 tracker->SaveMainFrameTimeStamps(rect_ids, |
| 196 base::TimeTicks::FromInternalValue(200), | 196 base::TimeTicks::FromInternalValue(200), |
| 197 base::TimeTicks::FromInternalValue(280), 1); | 197 base::TimeTicks::FromInternalValue(280), 1); |
| 198 tracker->SaveMainFrameTimeStamps(rect_ids, | 198 tracker->SaveMainFrameTimeStamps(rect_ids, |
| 199 base::TimeTicks::FromInternalValue(400), | 199 base::TimeTicks::FromInternalValue(400), |
| 200 base::TimeTicks::FromInternalValue(470), 1); | 200 base::TimeTicks::FromInternalValue(470), 1); |
| 201 tracker->SaveMainFrameTimeStamps(rect_ids, | 201 tracker->SaveMainFrameTimeStamps(rect_ids, |
| 202 base::TimeTicks::FromInternalValue(100), | 202 base::TimeTicks::FromInternalValue(100), |
| 203 base::TimeTicks::FromInternalValue(160), 1); | 203 base::TimeTicks::FromInternalValue(160), 1); |
| 204 EXPECT_EQ( | 204 EXPECT_EQ( |
| 205 "{\"values\":[{\"events\":[" | 205 "{\"values\":[{\"events\":[" |
| 206 "{\"end_time\":160,\"frame_id\":1,\"timestamp\":100}," | 206 "{\"end_time\":160,\"frame_id\":1,\"timestamp\":100}," |
| 207 "{\"end_time\":280,\"frame_id\":1,\"timestamp\":200}," | 207 "{\"end_time\":280,\"frame_id\":1,\"timestamp\":200}," |
| 208 "{\"end_time\":470,\"frame_id\":1,\"timestamp\":400}],\"rect_id\":2}]}", | 208 "{\"end_time\":470,\"frame_id\":1,\"timestamp\":400}],\"rect_id\":2}]}", |
| 209 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); | 209 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); |
| 210 } | 210 } |
| 211 | 211 |
| 212 TEST(FrameTimingTrackerTest, MultipleFrameIds) { | 212 TEST(FrameTimingTrackerTest, MultipleFrameIds) { |
| 213 FakeImplTaskRunnerProvider task_runner_provider; | 213 FakeImplTaskRunnerProvider task_runner_provider; |
| 214 TestSharedBitmapManager shared_bitmap_manager; | 214 TestSharedBitmapManager shared_bitmap_manager; |
| 215 TestTaskGraphRunner task_graph_runner; | 215 TestTaskGraphRunner task_graph_runner; |
| 216 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 216 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 217 &task_graph_runner); | 217 &task_graph_runner); |
| 218 | 218 |
| 219 scoped_ptr<FrameTimingTracker> tracker( | 219 std::unique_ptr<FrameTimingTracker> tracker( |
| 220 FrameTimingTracker::Create(&host_impl)); | 220 FrameTimingTracker::Create(&host_impl)); |
| 221 | 221 |
| 222 std::vector<std::pair<int, int64_t>> ids200; | 222 std::vector<std::pair<int, int64_t>> ids200; |
| 223 ids200.push_back(std::make_pair(1, 2)); | 223 ids200.push_back(std::make_pair(1, 2)); |
| 224 ids200.push_back(std::make_pair(1, 3)); | 224 ids200.push_back(std::make_pair(1, 3)); |
| 225 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(200), ids200); | 225 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(200), ids200); |
| 226 | 226 |
| 227 std::vector<std::pair<int, int64_t>> ids400; | 227 std::vector<std::pair<int, int64_t>> ids400; |
| 228 ids400.push_back(std::make_pair(2, 2)); | 228 ids400.push_back(std::make_pair(2, 2)); |
| 229 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(400), ids400); | 229 tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(400), ids400); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 248 CompositeToString(tracker->GroupCompositeCountsByRectId())); | 248 CompositeToString(tracker->GroupCompositeCountsByRectId())); |
| 249 } | 249 } |
| 250 | 250 |
| 251 TEST(FrameTimingTrackerTest, MultipleMainFrameEvents) { | 251 TEST(FrameTimingTrackerTest, MultipleMainFrameEvents) { |
| 252 FakeImplTaskRunnerProvider task_runner_provider; | 252 FakeImplTaskRunnerProvider task_runner_provider; |
| 253 TestSharedBitmapManager shared_bitmap_manager; | 253 TestSharedBitmapManager shared_bitmap_manager; |
| 254 TestTaskGraphRunner task_graph_runner; | 254 TestTaskGraphRunner task_graph_runner; |
| 255 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 255 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 256 &task_graph_runner); | 256 &task_graph_runner); |
| 257 | 257 |
| 258 scoped_ptr<FrameTimingTracker> tracker( | 258 std::unique_ptr<FrameTimingTracker> tracker( |
| 259 FrameTimingTracker::Create(&host_impl)); | 259 FrameTimingTracker::Create(&host_impl)); |
| 260 | 260 |
| 261 std::vector<int64_t> rect_ids200; | 261 std::vector<int64_t> rect_ids200; |
| 262 rect_ids200.push_back(2); | 262 rect_ids200.push_back(2); |
| 263 rect_ids200.push_back(3); | 263 rect_ids200.push_back(3); |
| 264 tracker->SaveMainFrameTimeStamps(rect_ids200, | 264 tracker->SaveMainFrameTimeStamps(rect_ids200, |
| 265 base::TimeTicks::FromInternalValue(200), | 265 base::TimeTicks::FromInternalValue(200), |
| 266 base::TimeTicks::FromInternalValue(220), 1); | 266 base::TimeTicks::FromInternalValue(220), 1); |
| 267 | 267 |
| 268 std::vector<int64_t> rect_ids400; | 268 std::vector<int64_t> rect_ids400; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 288 "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}," | 288 "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}," |
| 289 "{\"end_time\":220,\"frame_id\":1,\"timestamp\":200}],\"rect_id\":3}," | 289 "{\"end_time\":220,\"frame_id\":1,\"timestamp\":200}],\"rect_id\":3}," |
| 290 "{\"events\":[" | 290 "{\"events\":[" |
| 291 "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}],\"rect_id\":4}" | 291 "{\"end_time\":110,\"frame_id\":3,\"timestamp\":100}],\"rect_id\":4}" |
| 292 "]}", | 292 "]}", |
| 293 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); | 293 MainFrameToString(tracker->GroupMainFrameCountsByRectId())); |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace | 296 } // namespace |
| 297 } // namespace cc | 297 } // namespace cc |
| OLD | NEW |