OLD | NEW |
| (Empty) |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "cc/scrollbar_layer.h" | |
6 | |
7 #include "cc/animation/scrollbar_animation_controller.h" | |
8 #include "cc/append_quads_data.h" | |
9 #include "cc/quads/solid_color_draw_quad.h" | |
10 #include "cc/resources/prioritized_resource_manager.h" | |
11 #include "cc/resources/priority_calculator.h" | |
12 #include "cc/resources/resource_update_queue.h" | |
13 #include "cc/scrollbar_layer_impl.h" | |
14 #include "cc/test/fake_impl_proxy.h" | |
15 #include "cc/test/fake_layer_tree_host_client.h" | |
16 #include "cc/test/fake_layer_tree_host_impl.h" | |
17 #include "cc/test/fake_scrollbar_theme_painter.h" | |
18 #include "cc/test/fake_web_scrollbar.h" | |
19 #include "cc/test/fake_web_scrollbar_theme_geometry.h" | |
20 #include "cc/test/geometry_test_utils.h" | |
21 #include "cc/test/layer_tree_test_common.h" | |
22 #include "cc/test/mock_quad_culler.h" | |
23 #include "cc/test/test_web_graphics_context_3d.h" | |
24 #include "cc/trees/layer_tree_impl.h" | |
25 #include "cc/trees/single_thread_proxy.h" | |
26 #include "cc/trees/tree_synchronizer.h" | |
27 #include "testing/gmock/include/gmock/gmock.h" | |
28 #include "testing/gtest/include/gtest/gtest.h" | |
29 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbar.h" | |
30 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbarThemeGe
ometry.h" | |
31 | |
32 namespace cc { | |
33 namespace { | |
34 | |
35 scoped_ptr<LayerImpl> layerImplForScrollAreaAndScrollbar( | |
36 FakeLayerTreeHostImpl* host_impl, | |
37 scoped_ptr<WebKit::WebScrollbar> scrollbar, | |
38 bool reverse_order) | |
39 { | |
40 scoped_refptr<Layer> layerTreeRoot = Layer::Create(); | |
41 scoped_refptr<Layer> child1 = Layer::Create(); | |
42 scoped_refptr<Layer> child2 = ScrollbarLayer::Create(scrollbar.Pass(), FakeS
crollbarThemePainter::Create(false).PassAs<ScrollbarThemePainter>(), FakeWebScro
llbarThemeGeometry::create(true), child1->id()); | |
43 layerTreeRoot->AddChild(child1); | |
44 layerTreeRoot->InsertChild(child2, reverse_order ? 0 : 1); | |
45 scoped_ptr<LayerImpl> layerImpl = TreeSynchronizer::SynchronizeTrees(layerTr
eeRoot.get(), scoped_ptr<LayerImpl>(), host_impl->active_tree()); | |
46 TreeSynchronizer::PushProperties(layerTreeRoot.get(), layerImpl.get()); | |
47 return layerImpl.Pass(); | |
48 } | |
49 | |
50 TEST(ScrollbarLayerTest, resolveScrollLayerPointer) | |
51 { | |
52 FakeImplProxy proxy; | |
53 FakeLayerTreeHostImpl hostImpl(&proxy); | |
54 | |
55 { | |
56 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::Create()); | |
57 scoped_ptr<LayerImpl> layerImplTreeRoot = layerImplForScrollAreaAndScrol
lbar(&hostImpl, scrollbar.Pass(), false); | |
58 | |
59 LayerImpl* ccChild1 = layerImplTreeRoot->children()[0]; | |
60 ScrollbarLayerImpl* ccChild2 = static_cast<ScrollbarLayerImpl*>(layerImp
lTreeRoot->children()[1]); | |
61 | |
62 EXPECT_EQ(ccChild1->horizontal_scrollbar_layer(), ccChild2); | |
63 } | |
64 | |
65 { // another traverse order | |
66 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::Create()); | |
67 scoped_ptr<LayerImpl> layerImplTreeRoot = layerImplForScrollAreaAndScrol
lbar(&hostImpl, scrollbar.Pass(), true); | |
68 | |
69 ScrollbarLayerImpl* ccChild1 = static_cast<ScrollbarLayerImpl*>(layerImp
lTreeRoot->children()[0]); | |
70 LayerImpl* ccChild2 = layerImplTreeRoot->children()[1]; | |
71 | |
72 EXPECT_EQ(ccChild2->horizontal_scrollbar_layer(), ccChild1); | |
73 } | |
74 } | |
75 | |
76 TEST(ScrollbarLayerTest, shouldScrollNonOverlayOnMainThread) | |
77 { | |
78 FakeImplProxy proxy; | |
79 FakeLayerTreeHostImpl hostImpl(&proxy); | |
80 | |
81 // Create and attach a non-overlay scrollbar. | |
82 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::Create()); | |
83 static_cast<FakeWebScrollbar*>(scrollbar.get())->setOverlay(false); | |
84 scoped_ptr<LayerImpl> layerImplTreeRoot = layerImplForScrollAreaAndScrollbar
(&hostImpl, scrollbar.Pass(), false); | |
85 ScrollbarLayerImpl* scrollbarLayerImpl = static_cast<ScrollbarLayerImpl*>(la
yerImplTreeRoot->children()[1]); | |
86 | |
87 // When the scrollbar is not an overlay scrollbar, the scroll should be | |
88 // responded to on the main thread as the compositor does not yet implement | |
89 // scrollbar scrolling. | |
90 EXPECT_EQ(InputHandlerClient::ScrollOnMainThread, scrollbarLayerImpl->TryScr
oll(gfx::Point(0, 0), InputHandlerClient::Gesture)); | |
91 | |
92 // Create and attach an overlay scrollbar. | |
93 scrollbar = FakeWebScrollbar::Create(); | |
94 static_cast<FakeWebScrollbar*>(scrollbar.get())->setOverlay(true); | |
95 | |
96 layerImplTreeRoot = layerImplForScrollAreaAndScrollbar(&hostImpl, scrollbar.
Pass(), false); | |
97 scrollbarLayerImpl = static_cast<ScrollbarLayerImpl*>(layerImplTreeRoot->chi
ldren()[1]); | |
98 | |
99 // The user shouldn't be able to drag an overlay scrollbar and the scroll | |
100 // may be handled in the compositor. | |
101 EXPECT_EQ(InputHandlerClient::ScrollIgnored, scrollbarLayerImpl->TryScroll(g
fx::Point(0, 0), InputHandlerClient::Gesture)); | |
102 } | |
103 | |
104 TEST(ScrollbarLayerTest, scrollOffsetSynchronization) | |
105 { | |
106 FakeImplProxy proxy; | |
107 FakeLayerTreeHostImpl hostImpl(&proxy); | |
108 | |
109 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::Create()); | |
110 scoped_refptr<Layer> layerTreeRoot = Layer::Create(); | |
111 scoped_refptr<Layer> contentLayer = Layer::Create(); | |
112 scoped_refptr<Layer> scrollbarLayer = ScrollbarLayer::Create(scrollbar.Pass(
), FakeScrollbarThemePainter::Create(false).PassAs<ScrollbarThemePainter>(), Fak
eWebScrollbarThemeGeometry::create(true), layerTreeRoot->id()); | |
113 layerTreeRoot->AddChild(contentLayer); | |
114 layerTreeRoot->AddChild(scrollbarLayer); | |
115 | |
116 layerTreeRoot->SetScrollOffset(gfx::Vector2d(10, 20)); | |
117 layerTreeRoot->SetMaxScrollOffset(gfx::Vector2d(30, 50)); | |
118 layerTreeRoot->SetBounds(gfx::Size(100, 200)); | |
119 contentLayer->SetBounds(gfx::Size(100, 200)); | |
120 | |
121 scoped_ptr<LayerImpl> layerImplTreeRoot = TreeSynchronizer::SynchronizeTrees
(layerTreeRoot.get(), scoped_ptr<LayerImpl>(), hostImpl.active_tree()); | |
122 TreeSynchronizer::PushProperties(layerTreeRoot.get(), layerImplTreeRoot.get(
)); | |
123 | |
124 ScrollbarLayerImpl* ccScrollbarLayer = static_cast<ScrollbarLayerImpl*>(laye
rImplTreeRoot->children()[1]); | |
125 | |
126 EXPECT_EQ(10, ccScrollbarLayer->CurrentPos()); | |
127 EXPECT_EQ(100, ccScrollbarLayer->TotalSize()); | |
128 EXPECT_EQ(30, ccScrollbarLayer->Maximum()); | |
129 | |
130 layerTreeRoot->SetScrollOffset(gfx::Vector2d(100, 200)); | |
131 layerTreeRoot->SetMaxScrollOffset(gfx::Vector2d(300, 500)); | |
132 layerTreeRoot->SetBounds(gfx::Size(1000, 2000)); | |
133 contentLayer->SetBounds(gfx::Size(1000, 2000)); | |
134 | |
135 ScrollbarAnimationController* scrollbarController = layerImplTreeRoot->scrol
lbar_animation_controller(); | |
136 layerImplTreeRoot = TreeSynchronizer::SynchronizeTrees(layerTreeRoot.get(),
layerImplTreeRoot.Pass(), hostImpl.active_tree()); | |
137 TreeSynchronizer::PushProperties(layerTreeRoot.get(), layerImplTreeRoot.get(
)); | |
138 EXPECT_EQ(scrollbarController, layerImplTreeRoot->scrollbar_animation_contro
ller()); | |
139 | |
140 EXPECT_EQ(100, ccScrollbarLayer->CurrentPos()); | |
141 EXPECT_EQ(1000, ccScrollbarLayer->TotalSize()); | |
142 EXPECT_EQ(300, ccScrollbarLayer->Maximum()); | |
143 | |
144 layerImplTreeRoot->ScrollBy(gfx::Vector2d(12, 34)); | |
145 | |
146 EXPECT_EQ(112, ccScrollbarLayer->CurrentPos()); | |
147 EXPECT_EQ(1000, ccScrollbarLayer->TotalSize()); | |
148 EXPECT_EQ(300, ccScrollbarLayer->Maximum()); | |
149 } | |
150 | |
151 TEST(ScrollbarLayerTest, solidColorDrawQuads) | |
152 { | |
153 LayerTreeSettings layerTreeSettings; | |
154 layerTreeSettings.solidColorScrollbars = true; | |
155 layerTreeSettings.solidColorScrollbarThicknessDIP = 3; | |
156 FakeImplProxy proxy; | |
157 FakeLayerTreeHostImpl hostImpl(layerTreeSettings, &proxy); | |
158 | |
159 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::Create()); | |
160 static_cast<FakeWebScrollbar*>(scrollbar.get())->setOverlay(true); | |
161 scoped_ptr<LayerImpl> layerImplTreeRoot = layerImplForScrollAreaAndScrollbar
(&hostImpl, scrollbar.Pass(), false); | |
162 ScrollbarLayerImpl* scrollbarLayerImpl = static_cast<ScrollbarLayerImpl*>(la
yerImplTreeRoot->children()[1]); | |
163 scrollbarLayerImpl->SetThumbSize(gfx::Size(4, 4)); | |
164 scrollbarLayerImpl->SetViewportWithinScrollableArea( | |
165 gfx::RectF(10.f, 0.f, 40.f, 0.f), gfx::SizeF(100.f, 100.f)); | |
166 | |
167 // Thickness should be overridden to 3. | |
168 { | |
169 MockQuadCuller quadCuller; | |
170 AppendQuadsData data; | |
171 scrollbarLayerImpl->AppendQuads(&quadCuller, &data); | |
172 | |
173 const QuadList& quads = quadCuller.quadList(); | |
174 ASSERT_EQ(1, quads.size()); | |
175 EXPECT_EQ(DrawQuad::SOLID_COLOR, quads[0]->material); | |
176 EXPECT_RECT_EQ(gfx::Rect(1, 0, 4, 3), quads[0]->rect); | |
177 } | |
178 | |
179 // Contents scale should scale the draw quad. | |
180 scrollbarLayerImpl->draw_properties().contents_scale_x = 2; | |
181 scrollbarLayerImpl->draw_properties().contents_scale_y = 2; | |
182 { | |
183 MockQuadCuller quadCuller; | |
184 AppendQuadsData data; | |
185 scrollbarLayerImpl->AppendQuads(&quadCuller, &data); | |
186 | |
187 const QuadList& quads = quadCuller.quadList(); | |
188 ASSERT_EQ(1, quads.size()); | |
189 EXPECT_EQ(DrawQuad::SOLID_COLOR, quads[0]->material); | |
190 EXPECT_RECT_EQ(gfx::Rect(2, 0, 8, 6), quads[0]->rect); | |
191 } | |
192 scrollbarLayerImpl->draw_properties().contents_scale_x = 1; | |
193 scrollbarLayerImpl->draw_properties().contents_scale_y = 1; | |
194 | |
195 // For solid color scrollbars, position and size should reflect the | |
196 // viewport, not the geometry object. | |
197 scrollbarLayerImpl->SetViewportWithinScrollableArea( | |
198 gfx::RectF(40.f, 0.f, 20.f, 0.f), gfx::SizeF(100.f, 100.f)); | |
199 { | |
200 MockQuadCuller quadCuller; | |
201 AppendQuadsData data; | |
202 scrollbarLayerImpl->AppendQuads(&quadCuller, &data); | |
203 | |
204 const QuadList& quads = quadCuller.quadList(); | |
205 ASSERT_EQ(1, quads.size()); | |
206 EXPECT_EQ(DrawQuad::SOLID_COLOR, quads[0]->material); | |
207 EXPECT_RECT_EQ(gfx::Rect(4, 0, 2, 3), quads[0]->rect); | |
208 } | |
209 | |
210 } | |
211 | |
212 class ScrollbarLayerTestMaxTextureSize : public ThreadedTest { | |
213 public: | |
214 ScrollbarLayerTestMaxTextureSize() {} | |
215 | |
216 void setScrollbarBounds(gfx::Size bounds) { | |
217 bounds_ = bounds; | |
218 } | |
219 | |
220 virtual void beginTest() OVERRIDE | |
221 { | |
222 m_layerTreeHost->InitializeRendererIfNeeded(); | |
223 | |
224 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::Create()); | |
225 m_scrollbarLayer = ScrollbarLayer::Create(scrollbar.Pass(), FakeScrollba
rThemePainter::Create(false).PassAs<ScrollbarThemePainter>(), FakeWebScrollbarTh
emeGeometry::create(true), 1); | |
226 m_scrollbarLayer->SetLayerTreeHost(m_layerTreeHost.get()); | |
227 m_scrollbarLayer->SetBounds(bounds_); | |
228 m_layerTreeHost->root_layer()->AddChild(m_scrollbarLayer); | |
229 | |
230 m_scrollLayer = Layer::Create(); | |
231 m_scrollbarLayer->SetScrollLayerId(m_scrollLayer->id()); | |
232 m_layerTreeHost->root_layer()->AddChild(m_scrollLayer); | |
233 | |
234 postSetNeedsCommitToMainThread(); | |
235 } | |
236 | |
237 virtual void commitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE | |
238 { | |
239 const int kMaxTextureSize = impl->GetRendererCapabilities().max_texture_
size; | |
240 | |
241 // Check first that we're actually testing something. | |
242 EXPECT_GT(m_scrollbarLayer->bounds().width(), kMaxTextureSize); | |
243 | |
244 EXPECT_EQ(m_scrollbarLayer->content_bounds().width(), kMaxTextureSize -
1); | |
245 EXPECT_EQ(m_scrollbarLayer->content_bounds().height(), kMaxTextureSize -
1); | |
246 | |
247 endTest(); | |
248 } | |
249 | |
250 virtual void afterTest() OVERRIDE | |
251 { | |
252 } | |
253 | |
254 private: | |
255 scoped_refptr<ScrollbarLayer> m_scrollbarLayer; | |
256 scoped_refptr<Layer> m_scrollLayer; | |
257 gfx::Size bounds_; | |
258 }; | |
259 | |
260 TEST_F(ScrollbarLayerTestMaxTextureSize, runTest) { | |
261 scoped_ptr<TestWebGraphicsContext3D> context = TestWebGraphicsContext3D::Cre
ate(); | |
262 int max_size = 0; | |
263 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); | |
264 setScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); | |
265 runTest(true); | |
266 } | |
267 | |
268 class MockLayerTreeHost : public LayerTreeHost { | |
269 public: | |
270 MockLayerTreeHost(const LayerTreeSettings& settings) | |
271 : LayerTreeHost(&m_fakeClient, settings) | |
272 { | |
273 Initialize(scoped_ptr<Thread>(NULL)); | |
274 } | |
275 | |
276 private: | |
277 FakeLayerImplTreeHostClient m_fakeClient; | |
278 }; | |
279 | |
280 | |
281 class ScrollbarLayerTestResourceCreation : public testing::Test { | |
282 public: | |
283 ScrollbarLayerTestResourceCreation() | |
284 { | |
285 } | |
286 | |
287 void testResourceUpload(int expectedResources) | |
288 { | |
289 m_layerTreeHost.reset(new MockLayerTreeHost(m_layerTreeSettings)); | |
290 | |
291 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::Create()); | |
292 scoped_refptr<Layer> layerTreeRoot = Layer::Create(); | |
293 scoped_refptr<Layer> contentLayer = Layer::Create(); | |
294 scoped_refptr<Layer> scrollbarLayer = ScrollbarLayer::Create(scrollbar.P
ass(), FakeScrollbarThemePainter::Create(false).PassAs<ScrollbarThemePainter>(),
FakeWebScrollbarThemeGeometry::create(true), layerTreeRoot->id()); | |
295 layerTreeRoot->AddChild(contentLayer); | |
296 layerTreeRoot->AddChild(scrollbarLayer); | |
297 | |
298 m_layerTreeHost->InitializeRendererIfNeeded(); | |
299 m_layerTreeHost->contents_texture_manager()->setMaxMemoryLimitBytes(1024
* 1024); | |
300 m_layerTreeHost->SetRootLayer(layerTreeRoot); | |
301 | |
302 scrollbarLayer->SetIsDrawable(true); | |
303 scrollbarLayer->SetBounds(gfx::Size(100, 100)); | |
304 layerTreeRoot->SetScrollOffset(gfx::Vector2d(10, 20)); | |
305 layerTreeRoot->SetMaxScrollOffset(gfx::Vector2d(30, 50)); | |
306 layerTreeRoot->SetBounds(gfx::Size(100, 200)); | |
307 contentLayer->SetBounds(gfx::Size(100, 200)); | |
308 scrollbarLayer->draw_properties().content_bounds = gfx::Size(100, 200); | |
309 scrollbarLayer->draw_properties().visible_content_rect = gfx::Rect(0, 0,
100, 200); | |
310 scrollbarLayer->CreateRenderSurface(); | |
311 scrollbarLayer->draw_properties().render_target = scrollbarLayer; | |
312 | |
313 testing::Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); | |
314 EXPECT_EQ(scrollbarLayer->layer_tree_host(), m_layerTreeHost.get()); | |
315 | |
316 PriorityCalculator calculator; | |
317 ResourceUpdateQueue queue; | |
318 OcclusionTracker occlusionTracker(gfx::Rect(), false); | |
319 | |
320 scrollbarLayer->SetTexturePriorities(calculator); | |
321 m_layerTreeHost->contents_texture_manager()->prioritizeTextures(); | |
322 scrollbarLayer->Update(&queue, &occlusionTracker, NULL); | |
323 EXPECT_EQ(0, queue.fullUploadSize()); | |
324 EXPECT_EQ(expectedResources, queue.partialUploadSize()); | |
325 | |
326 testing::Mock::VerifyAndClearExpectations(m_layerTreeHost.get()); | |
327 } | |
328 | |
329 protected: | |
330 scoped_ptr<MockLayerTreeHost> m_layerTreeHost; | |
331 LayerTreeSettings m_layerTreeSettings; | |
332 }; | |
333 | |
334 TEST_F(ScrollbarLayerTestResourceCreation, resourceUpload) | |
335 { | |
336 m_layerTreeSettings.solidColorScrollbars = false; | |
337 testResourceUpload(2); | |
338 } | |
339 | |
340 TEST_F(ScrollbarLayerTestResourceCreation, solidColorNoResourceUpload) | |
341 { | |
342 m_layerTreeSettings.solidColorScrollbars = true; | |
343 testResourceUpload(0); | |
344 } | |
345 | |
346 TEST(ScrollbarLayerTest, pinchZoomScrollbarUpdates) | |
347 { | |
348 FakeImplProxy proxy; | |
349 FakeLayerTreeHostImpl hostImpl(&proxy); | |
350 | |
351 scoped_refptr<Layer> layerTreeRoot = Layer::Create(); | |
352 layerTreeRoot->SetScrollable(true); | |
353 | |
354 scoped_refptr<Layer> contentLayer = Layer::Create(); | |
355 scoped_ptr<WebKit::WebScrollbar> scrollbar1(FakeWebScrollbar::Create()); | |
356 scoped_refptr<Layer> scrollbarLayerHorizontal = | |
357 ScrollbarLayer::Create(scrollbar1.Pass(), | |
358 FakeScrollbarThemePainter::Create(false).PassAs<ScrollbarThemePainter>()
, | |
359 FakeWebScrollbarThemeGeometry::create(true), | |
360 Layer::PINCH_ZOOM_ROOT_SCROLL_LAYER_ID); | |
361 scoped_ptr<WebKit::WebScrollbar> scrollbar2(FakeWebScrollbar::Create()); | |
362 scoped_refptr<Layer> scrollbarLayerVertical = | |
363 ScrollbarLayer::Create(scrollbar2.Pass(), | |
364 FakeScrollbarThemePainter::Create(false).PassAs<ScrollbarThemePainter>()
, | |
365 FakeWebScrollbarThemeGeometry::create(true), | |
366 Layer::PINCH_ZOOM_ROOT_SCROLL_LAYER_ID); | |
367 | |
368 layerTreeRoot->AddChild(contentLayer); | |
369 layerTreeRoot->AddChild(scrollbarLayerHorizontal); | |
370 layerTreeRoot->AddChild(scrollbarLayerVertical); | |
371 | |
372 layerTreeRoot->SetScrollOffset(gfx::Vector2d(10, 20)); | |
373 layerTreeRoot->SetMaxScrollOffset(gfx::Vector2d(30, 50)); | |
374 layerTreeRoot->SetBounds(gfx::Size(100, 200)); | |
375 contentLayer->SetBounds(gfx::Size(100, 200)); | |
376 | |
377 scoped_ptr<LayerImpl> layerImplTreeRoot = | |
378 TreeSynchronizer::SynchronizeTrees(layerTreeRoot.get(), | |
379 scoped_ptr<LayerImpl>(), hostImpl.active_tree()); | |
380 TreeSynchronizer::PushProperties(layerTreeRoot.get(), | |
381 layerImplTreeRoot.get()); | |
382 | |
383 ScrollbarLayerImpl* pinchZoomHorizontal = static_cast<ScrollbarLayerImpl*>( | |
384 layerImplTreeRoot->children()[1]); | |
385 ScrollbarLayerImpl* pinchZoomVertical = static_cast<ScrollbarLayerImpl*>( | |
386 layerImplTreeRoot->children()[2]); | |
387 | |
388 // Need a root layer in the active tree in order for DidUpdateScroll() | |
389 // to work. | |
390 hostImpl.active_tree()->SetRootLayer(layerImplTreeRoot.Pass()); | |
391 hostImpl.active_tree()->FindRootScrollLayer(); | |
392 | |
393 // Manually set the pinch-zoom layers: normally this is done by | |
394 // LayerTreeHost. | |
395 hostImpl.active_tree()->SetPinchZoomHorizontalLayerId( | |
396 pinchZoomHorizontal->id()); | |
397 hostImpl.active_tree()->SetPinchZoomVerticalLayerId( | |
398 pinchZoomVertical->id()); | |
399 | |
400 hostImpl.active_tree()->DidUpdateScroll(); | |
401 | |
402 EXPECT_EQ(10, pinchZoomHorizontal->CurrentPos()); | |
403 EXPECT_EQ(100, pinchZoomHorizontal->TotalSize()); | |
404 EXPECT_EQ(30, pinchZoomHorizontal->Maximum()); | |
405 EXPECT_EQ(20, pinchZoomVertical->CurrentPos()); | |
406 EXPECT_EQ(200, pinchZoomVertical->TotalSize()); | |
407 EXPECT_EQ(50, pinchZoomVertical->Maximum()); | |
408 } | |
409 | |
410 } // namespace | |
411 } // namespace cc | |
OLD | NEW |