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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 81533002: Use LatencyInfoSwapPromise to track LatencyInfo through compositor (Closed) Base URL: http://git.chromium.org/chromium/src.git@swap_promise_2
Patch Set: rebase Created 7 years 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
OLDNEW
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 5214 matching lines...) Expand 10 before | Expand all | Expand 10 after
5225 5225
5226 bool did_swap_called; 5226 bool did_swap_called;
5227 bool did_not_swap_called; 5227 bool did_not_swap_called;
5228 bool dtor_called; 5228 bool dtor_called;
5229 SwapPromise::DidNotSwapReason reason; 5229 SwapPromise::DidNotSwapReason reason;
5230 }; 5230 };
5231 5231
5232 class TestSwapPromise : public SwapPromise { 5232 class TestSwapPromise : public SwapPromise {
5233 public: 5233 public:
5234 explicit TestSwapPromise(TestSwapPromiseResult* result) 5234 explicit TestSwapPromise(TestSwapPromiseResult* result)
5235 : result_(result) { 5235 : SwapPromise(SWAP_PROMISE_UNKNOWN),
5236 result_(result) {
5236 } 5237 }
5237 5238
5238 virtual ~TestSwapPromise() { 5239 virtual ~TestSwapPromise() {
5239 result_->dtor_called = true; 5240 result_->dtor_called = true;
5240 } 5241 }
5241 5242
5242 virtual void DidSwap() OVERRIDE { 5243 virtual void DidSwap() OVERRIDE {
5243 EXPECT_FALSE(result_->did_swap_called); 5244 EXPECT_FALSE(result_->did_swap_called);
5244 EXPECT_FALSE(result_->did_not_swap_called); 5245 EXPECT_FALSE(result_->did_not_swap_called);
5245 result_->did_swap_called = true; 5246 result_->did_swap_called = true;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
5317 } 5318 }
5318 5319
5319 int commit_count_; 5320 int commit_count_;
5320 int commit_complete_count_; 5321 int commit_complete_count_;
5321 TestSwapPromiseResult swap_promise_result_[3]; 5322 TestSwapPromiseResult swap_promise_result_[3];
5322 }; 5323 };
5323 5324
5324 MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise); 5325 MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise);
5325 5326
5326 } // namespace cc 5327 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698