| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 6141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6152 if (!check_results_on_commit_) | 6152 if (!check_results_on_commit_) |
| 6153 return; | 6153 return; |
| 6154 | 6154 |
| 6155 // Since in reality, the events will be read by LayerTreeHost during commit, | 6155 // Since in reality, the events will be read by LayerTreeHost during commit, |
| 6156 // we check the requests here to ensure that they are correct at the next | 6156 // we check the requests here to ensure that they are correct at the next |
| 6157 // commit time (as opposed to checking in DrawLayers for instance). | 6157 // commit time (as opposed to checking in DrawLayers for instance). |
| 6158 // TODO(vmpstr): Change this to read things from the main thread when this | 6158 // TODO(vmpstr): Change this to read things from the main thread when this |
| 6159 // information is propagated to the main thread (not yet implemented). | 6159 // information is propagated to the main thread (not yet implemented). |
| 6160 FrameTimingTracker* tracker = host_impl->frame_timing_tracker(); | 6160 FrameTimingTracker* tracker = host_impl->frame_timing_tracker(); |
| 6161 scoped_ptr<FrameTimingTracker::CompositeTimingSet> timing_set = | 6161 scoped_ptr<FrameTimingTracker::CompositeTimingSet> timing_set = |
| 6162 tracker->GroupCountsByRectId(); | 6162 tracker->GroupCompositeCountsByRectId(); |
| 6163 EXPECT_EQ(1u, timing_set->size()); | 6163 EXPECT_EQ(1u, timing_set->size()); |
| 6164 auto rect_1_it = timing_set->find(1); | 6164 auto rect_1_it = timing_set->find(1); |
| 6165 EXPECT_TRUE(rect_1_it != timing_set->end()); | 6165 EXPECT_TRUE(rect_1_it != timing_set->end()); |
| 6166 const auto& timing_events = rect_1_it->second; | 6166 const auto& timing_events = rect_1_it->second; |
| 6167 EXPECT_EQ(1u, timing_events.size()); | 6167 EXPECT_EQ(1u, timing_events.size()); |
| 6168 EXPECT_EQ(host_impl->active_tree()->source_frame_number(), | 6168 EXPECT_EQ(host_impl->active_tree()->source_frame_number(), |
| 6169 timing_events[0].frame_id); | 6169 timing_events[0].frame_id); |
| 6170 EXPECT_GT(timing_events[0].timestamp, base::TimeTicks()); | 6170 EXPECT_GT(timing_events[0].timestamp, base::TimeTicks()); |
| 6171 | 6171 |
| 6172 EndTest(); | 6172 EndTest(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6261 | 6261 |
| 6262 void AfterTest() override { EXPECT_TRUE(did_commit_); } | 6262 void AfterTest() override { EXPECT_TRUE(did_commit_); } |
| 6263 | 6263 |
| 6264 private: | 6264 private: |
| 6265 bool did_commit_; | 6265 bool did_commit_; |
| 6266 }; | 6266 }; |
| 6267 | 6267 |
| 6268 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit); | 6268 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit); |
| 6269 | 6269 |
| 6270 } // namespace cc | 6270 } // namespace cc |
| OLD | NEW |