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

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

Issue 2185823005: Make RenderViewImpl::OnForceRedraw more robust (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments and add tests Created 4 years, 4 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 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 4473 matching lines...) Expand 10 before | Expand all | Expand 10 after
4484 result_->did_activate_called = true; 4484 result_->did_activate_called = true;
4485 } 4485 }
4486 4486
4487 void DidSwap(CompositorFrameMetadata* metadata) override { 4487 void DidSwap(CompositorFrameMetadata* metadata) override {
4488 base::AutoLock lock(result_->lock); 4488 base::AutoLock lock(result_->lock);
4489 EXPECT_FALSE(result_->did_swap_called); 4489 EXPECT_FALSE(result_->did_swap_called);
4490 EXPECT_FALSE(result_->did_not_swap_called); 4490 EXPECT_FALSE(result_->did_not_swap_called);
4491 result_->did_swap_called = true; 4491 result_->did_swap_called = true;
4492 } 4492 }
4493 4493
4494 void DidNotSwap(DidNotSwapReason reason) override { 4494 DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override {
4495 base::AutoLock lock(result_->lock); 4495 base::AutoLock lock(result_->lock);
4496 EXPECT_FALSE(result_->did_swap_called); 4496 EXPECT_FALSE(result_->did_swap_called);
4497 EXPECT_FALSE(result_->did_not_swap_called); 4497 EXPECT_FALSE(result_->did_not_swap_called);
4498 EXPECT_FALSE(result_->did_activate_called && 4498 EXPECT_FALSE(result_->did_activate_called &&
4499 reason != DidNotSwapReason::SWAP_FAILS); 4499 reason != DidNotSwapReason::SWAP_FAILS);
4500 result_->did_not_swap_called = true; 4500 result_->did_not_swap_called = true;
4501 result_->reason = reason; 4501 result_->reason = reason;
4502 return DidNotSwapAction::DEFAULT_ACTION;
4502 } 4503 }
4503 4504
4504 int64_t TraceId() const override { return 0; } 4505 int64_t TraceId() const override { return 0; }
4505 4506
4506 private: 4507 private:
4507 // Not owned. 4508 // Not owned.
4508 TestSwapPromiseResult* result_; 4509 TestSwapPromiseResult* result_;
4509 }; 4510 };
4510 4511
4511 class PinnedLayerTreeSwapPromise : public LayerTreeHostTest { 4512 class PinnedLayerTreeSwapPromise : public LayerTreeHostTest {
(...skipping 2428 matching lines...) Expand 10 before | Expand all | Expand 10 after
6940 private: 6941 private:
6941 FakeContentLayerClient client_; 6942 FakeContentLayerClient client_;
6942 const gfx::Size viewport_size_; 6943 const gfx::Size viewport_size_;
6943 const gfx::Size large_image_size_; 6944 const gfx::Size large_image_size_;
6944 }; 6945 };
6945 6946
6946 SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationSucceedsWithLargeImage); 6947 SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationSucceedsWithLargeImage);
6947 6948
6948 } // namespace 6949 } // namespace
6949 } // namespace cc 6950 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698