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

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

Issue 2144303002: Made layout viewport scroll updates from compositor work like ordinary layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rootScrollerOnCompositor
Patch Set: Created 4 years, 5 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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 continue; 255 continue;
256 256
257 if (scroll_delta != scroll_info.scrolls[i].scroll_delta) { 257 if (scroll_delta != scroll_info.scrolls[i].scroll_delta) {
258 return ::testing::AssertionFailure() 258 return ::testing::AssertionFailure()
259 << "Expected " << scroll_delta.ToString() << ", not " 259 << "Expected " << scroll_delta.ToString() << ", not "
260 << scroll_info.scrolls[i].scroll_delta.ToString(); 260 << scroll_info.scrolls[i].scroll_delta.ToString();
261 } 261 }
262 times_encountered++; 262 times_encountered++;
263 } 263 }
264 264
265 if (id == scroll_info.inner_viewport_scroll.layer_id) {
266 if (scroll_delta != scroll_info.inner_viewport_scroll.scroll_delta) {
267 return ::testing::AssertionFailure()
268 << "Expected " << scroll_delta.ToString() << ", not "
269 << scroll_info.inner_viewport_scroll.scroll_delta.ToString();
270 }
271 times_encountered++;
272 }
273
265 if (times_encountered != 1) 274 if (times_encountered != 1)
266 return ::testing::AssertionFailure() << "No layer found with id " << id; 275 return ::testing::AssertionFailure() << "No layer found with id " << id;
267 return ::testing::AssertionSuccess(); 276 return ::testing::AssertionSuccess();
268 } 277 }
269 278
270 static void ExpectNone(const ScrollAndScaleSet& scroll_info, int id) { 279 static void ExpectNone(const ScrollAndScaleSet& scroll_info, int id) {
271 int times_encountered = 0; 280 int times_encountered = 0;
272 281
273 for (size_t i = 0; i < scroll_info.scrolls.size(); ++i) { 282 for (size_t i = 0; i < scroll_info.scrolls.size(); ++i) {
274 if (scroll_info.scrolls[i].layer_id != id) 283 if (scroll_info.scrolls[i].layer_id != id)
(...skipping 10771 matching lines...) Expand 10 before | Expand all | Expand 10 after
11046 11055
11047 // Re-initialize with a software output surface. 11056 // Re-initialize with a software output surface.
11048 output_surface_ = FakeOutputSurface::CreateSoftware( 11057 output_surface_ = FakeOutputSurface::CreateSoftware(
11049 base::WrapUnique(new SoftwareOutputDevice)); 11058 base::WrapUnique(new SoftwareOutputDevice));
11050 host_impl_->InitializeRenderer(output_surface_.get()); 11059 host_impl_->InitializeRenderer(output_surface_.get());
11051 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); 11060 EXPECT_FALSE(host_impl_->use_gpu_rasterization());
11052 } 11061 }
11053 11062
11054 } // namespace 11063 } // namespace
11055 } // namespace cc 11064 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698