OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if (!element) | 132 if (!element) |
133 return 0; | 133 return 0; |
134 RenderObject* renderer = element->renderer(); | 134 RenderObject* renderer = element->renderer(); |
135 if (!renderer || !renderer->isBoxModelObject()) | 135 if (!renderer || !renderer->isBoxModelObject()) |
136 return 0; | 136 return 0; |
137 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); | 137 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); |
138 if (!layer) | 138 if (!layer) |
139 return 0; | 139 return 0; |
140 if (!layer->hasCompositedLayerMapping()) | 140 if (!layer->hasCompositedLayerMapping()) |
141 return 0; | 141 return 0; |
142 CompositedLayerMappingPtr compositedLayerMapping = layer->compositedLayerMap
ping(); | 142 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi
ng(); |
143 GraphicsLayer* graphicsLayer = compositedLayerMapping->mainGraphicsLayer(); | 143 GraphicsLayer* graphicsLayer = compositedLayerMapping->mainGraphicsLayer(); |
144 if (!graphicsLayer) | 144 if (!graphicsLayer) |
145 return 0; | 145 return 0; |
146 return graphicsLayer->platformLayer(); | 146 return graphicsLayer->platformLayer(); |
147 } | 147 } |
148 | 148 |
149 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingForFixedPosition) | 149 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingForFixedPosition) |
150 { | 150 { |
151 registerMockedHttpURLLoad("fixed-position.html"); | 151 registerMockedHttpURLLoad("fixed-position.html"); |
152 navigateTo(m_baseURL + "fixed-position.html"); | 152 navigateTo(m_baseURL + "fixed-position.html"); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 ASSERT(scrollableElement); | 284 ASSERT(scrollableElement); |
285 | 285 |
286 RenderObject* renderer = scrollableElement->renderer(); | 286 RenderObject* renderer = scrollableElement->renderer(); |
287 ASSERT_TRUE(renderer->isBox()); | 287 ASSERT_TRUE(renderer->isBox()); |
288 ASSERT_TRUE(renderer->hasLayer()); | 288 ASSERT_TRUE(renderer->hasLayer()); |
289 | 289 |
290 RenderBox* box = toRenderBox(renderer); | 290 RenderBox* box = toRenderBox(renderer); |
291 ASSERT_TRUE(box->usesCompositedScrolling()); | 291 ASSERT_TRUE(box->usesCompositedScrolling()); |
292 ASSERT_EQ(PaintsIntoOwnBacking, box->layer()->compositingState()); | 292 ASSERT_EQ(PaintsIntoOwnBacking, box->layer()->compositingState()); |
293 | 293 |
294 CompositedLayerMappingPtr compositedLayerMapping = box->layer()->compositedL
ayerMapping(); | 294 CompositedLayerMapping* compositedLayerMapping = box->layer()->compositedLay
erMapping(); |
295 ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); | 295 ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); |
296 ASSERT(compositedLayerMapping->scrollingContentsLayer()); | 296 ASSERT(compositedLayerMapping->scrollingContentsLayer()); |
297 | 297 |
298 GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLaye
r(); | 298 GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLaye
r(); |
299 ASSERT_EQ(box->layer()->scrollableArea(), graphicsLayer->scrollableArea()); | 299 ASSERT_EQ(box->layer()->scrollableArea(), graphicsLayer->scrollableArea()); |
300 | 300 |
301 WebLayer* webScrollLayer = compositedLayerMapping->scrollingContentsLayer()-
>platformLayer(); | 301 WebLayer* webScrollLayer = compositedLayerMapping->scrollingContentsLayer()-
>platformLayer(); |
302 ASSERT_TRUE(webScrollLayer->scrollable()); | 302 ASSERT_TRUE(webScrollLayer->scrollable()); |
303 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); | 303 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); |
304 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); | 304 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); |
(...skipping 19 matching lines...) Expand all Loading... |
324 ASSERT(overflowElement); | 324 ASSERT(overflowElement); |
325 | 325 |
326 RenderObject* renderer = overflowElement->renderer(); | 326 RenderObject* renderer = overflowElement->renderer(); |
327 ASSERT_TRUE(renderer->isBox()); | 327 ASSERT_TRUE(renderer->isBox()); |
328 ASSERT_TRUE(renderer->hasLayer()); | 328 ASSERT_TRUE(renderer->hasLayer()); |
329 | 329 |
330 RenderBox* box = toRenderBox(renderer); | 330 RenderBox* box = toRenderBox(renderer); |
331 ASSERT_TRUE(box->usesCompositedScrolling()); | 331 ASSERT_TRUE(box->usesCompositedScrolling()); |
332 ASSERT_EQ(PaintsIntoOwnBacking, box->layer()->compositingState()); | 332 ASSERT_EQ(PaintsIntoOwnBacking, box->layer()->compositingState()); |
333 | 333 |
334 CompositedLayerMappingPtr compositedLayerMapping = box->layer()->compositedL
ayerMapping(); | 334 CompositedLayerMapping* compositedLayerMapping = box->layer()->compositedLay
erMapping(); |
335 ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); | 335 ASSERT_TRUE(compositedLayerMapping->hasScrollingLayer()); |
336 ASSERT(compositedLayerMapping->scrollingContentsLayer()); | 336 ASSERT(compositedLayerMapping->scrollingContentsLayer()); |
337 | 337 |
338 GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLaye
r(); | 338 GraphicsLayer* graphicsLayer = compositedLayerMapping->scrollingContentsLaye
r(); |
339 ASSERT_EQ(box->layer()->scrollableArea(), graphicsLayer->scrollableArea()); | 339 ASSERT_EQ(box->layer()->scrollableArea(), graphicsLayer->scrollableArea()); |
340 | 340 |
341 WebLayer* webScrollLayer = compositedLayerMapping->scrollingContentsLayer()-
>platformLayer(); | 341 WebLayer* webScrollLayer = compositedLayerMapping->scrollingContentsLayer()-
>platformLayer(); |
342 ASSERT_TRUE(webScrollLayer->scrollable()); | 342 ASSERT_TRUE(webScrollLayer->scrollable()); |
343 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); | 343 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); |
344 ASSERT_FALSE(webScrollLayer->userScrollableVertical()); | 344 ASSERT_FALSE(webScrollLayer->userScrollableVertical()); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) | 453 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) |
454 { | 454 { |
455 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); | 455 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); |
456 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); | 456 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); |
457 forceFullCompositingUpdate(); | 457 forceFullCompositingUpdate(); |
458 // This test document setup an iframe with scrollbars, then switch to | 458 // This test document setup an iframe with scrollbars, then switch to |
459 // an empty document by javascript. | 459 // an empty document by javascript. |
460 } | 460 } |
461 | 461 |
462 } // namespace | 462 } // namespace |
OLD | NEW |