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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 914403003: cc: Add main frame timing info to frame timing tracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 00f4f9aa68dd1d46012a5698aeda07456d3ae923..80b48d04addc04365c967988edceef2e265e9516 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -6463,16 +6463,35 @@ class LayerTreeHostTestFrameTimingRequestsSaveTimestamps
// TODO(vmpstr): Change this to read things from the main thread when this
// information is propagated to the main thread (not yet implemented).
FrameTimingTracker* tracker = host_impl->frame_timing_tracker();
- scoped_ptr<FrameTimingTracker::CompositeTimingSet> timing_set =
- tracker->GroupCountsByRectId();
- EXPECT_EQ(1u, timing_set->size());
- auto rect_1_it = timing_set->find(1);
- EXPECT_TRUE(rect_1_it != timing_set->end());
- const auto& timing_events = rect_1_it->second;
- EXPECT_EQ(1u, timing_events.size());
- EXPECT_EQ(host_impl->active_tree()->source_frame_number(),
- timing_events[0].frame_id);
- EXPECT_GT(timing_events[0].timestamp, base::TimeTicks());
+
+ // Check composite events.
+ {
+ scoped_ptr<FrameTimingTracker::CompositeTimingSet> timing_set =
+ tracker->GroupCompositeCountsByRectId();
+ EXPECT_EQ(1u, timing_set->size());
+ auto rect_1_it = timing_set->find(1);
+ EXPECT_TRUE(rect_1_it != timing_set->end());
+ const auto& timing_events = rect_1_it->second;
+ EXPECT_EQ(1u, timing_events.size());
+ EXPECT_EQ(host_impl->active_tree()->source_frame_number(),
+ timing_events[0].frame_id);
+ EXPECT_GT(timing_events[0].timestamp, base::TimeTicks());
+ }
+
+ // Check main frame events.
+ {
+ scoped_ptr<FrameTimingTracker::MainFrameTimingSet> timing_set =
+ tracker->GroupMainFrameCountsByRectId();
+ EXPECT_EQ(2u, timing_set->size());
+ auto rect_1_it = timing_set->find(1);
+ EXPECT_TRUE(rect_1_it != timing_set->end());
+ const auto& timing_events = rect_1_it->second;
+ EXPECT_EQ(1u, timing_events.size());
+ EXPECT_EQ(host_impl->active_tree()->source_frame_number(),
+ timing_events[0].frame_id);
+ EXPECT_GT(timing_events[0].timestamp, base::TimeTicks());
+ EXPECT_GT(timing_events[0].end_time, timing_events[0].timestamp);
+ }
EndTest();
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698