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

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: Initialize ScrollUpdateInfo's layer id in constructor 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 continue; 254 continue;
255 255
256 if (scroll_delta != scroll_info.scrolls[i].scroll_delta) { 256 if (scroll_delta != scroll_info.scrolls[i].scroll_delta) {
257 return ::testing::AssertionFailure() 257 return ::testing::AssertionFailure()
258 << "Expected " << scroll_delta.ToString() << ", not " 258 << "Expected " << scroll_delta.ToString() << ", not "
259 << scroll_info.scrolls[i].scroll_delta.ToString(); 259 << scroll_info.scrolls[i].scroll_delta.ToString();
260 } 260 }
261 times_encountered++; 261 times_encountered++;
262 } 262 }
263 263
264 if (id == scroll_info.inner_viewport_scroll.layer_id) {
265 if (scroll_delta != scroll_info.inner_viewport_scroll.scroll_delta) {
266 return ::testing::AssertionFailure()
267 << "Expected " << scroll_delta.ToString() << ", not "
268 << scroll_info.inner_viewport_scroll.scroll_delta.ToString();
269 }
270 times_encountered++;
271 }
272
264 if (times_encountered != 1) 273 if (times_encountered != 1)
265 return ::testing::AssertionFailure() << "No layer found with id " << id; 274 return ::testing::AssertionFailure() << "No layer found with id " << id;
266 return ::testing::AssertionSuccess(); 275 return ::testing::AssertionSuccess();
267 } 276 }
268 277
269 static void ExpectNone(const ScrollAndScaleSet& scroll_info, int id) { 278 static void ExpectNone(const ScrollAndScaleSet& scroll_info, int id) {
270 int times_encountered = 0; 279 int times_encountered = 0;
271 280
272 for (size_t i = 0; i < scroll_info.scrolls.size(); ++i) { 281 for (size_t i = 0; i < scroll_info.scrolls.size(); ++i) {
273 if (scroll_info.scrolls[i].layer_id != id) 282 if (scroll_info.scrolls[i].layer_id != id)
(...skipping 10771 matching lines...) Expand 10 before | Expand all | Expand 10 after
11045 11054
11046 // Re-initialize with a software output surface. 11055 // Re-initialize with a software output surface.
11047 output_surface_ = FakeOutputSurface::CreateSoftware( 11056 output_surface_ = FakeOutputSurface::CreateSoftware(
11048 base::WrapUnique(new SoftwareOutputDevice)); 11057 base::WrapUnique(new SoftwareOutputDevice));
11049 host_impl_->InitializeRenderer(output_surface_.get()); 11058 host_impl_->InitializeRenderer(output_surface_.get());
11050 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); 11059 EXPECT_FALSE(host_impl_->use_gpu_rasterization());
11051 } 11060 }
11052 11061
11053 } // namespace 11062 } // namespace
11054 } // namespace cc 11063 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698