| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 366 |
| 367 RenderObject* renderer = scrollableFrame->renderer(); | 367 RenderObject* renderer = scrollableFrame->renderer(); |
| 368 ASSERT_TRUE(renderer); | 368 ASSERT_TRUE(renderer); |
| 369 ASSERT_TRUE(renderer->isWidget()); | 369 ASSERT_TRUE(renderer->isWidget()); |
| 370 | 370 |
| 371 RenderWidget* renderWidget = toRenderWidget(renderer); | 371 RenderWidget* renderWidget = toRenderWidget(renderer); |
| 372 ASSERT_TRUE(renderWidget); | 372 ASSERT_TRUE(renderWidget); |
| 373 ASSERT_TRUE(renderWidget->widget()); | 373 ASSERT_TRUE(renderWidget->widget()); |
| 374 ASSERT_TRUE(renderWidget->widget()->isFrameView()); | 374 ASSERT_TRUE(renderWidget->widget()->isFrameView()); |
| 375 | 375 |
| 376 FrameView* innerFrameView = static_cast<FrameView*>(renderWidget->widget()); | 376 FrameView* innerFrameView = toFrameView(renderWidget->widget()); |
| 377 RenderView* innerRenderView = innerFrameView->renderView(); | 377 RenderView* innerRenderView = innerFrameView->renderView(); |
| 378 ASSERT_TRUE(innerRenderView); | 378 ASSERT_TRUE(innerRenderView); |
| 379 | 379 |
| 380 RenderLayerCompositor* innerCompositor = innerRenderView->compositor(); | 380 RenderLayerCompositor* innerCompositor = innerRenderView->compositor(); |
| 381 ASSERT_TRUE(innerCompositor->inCompositingMode()); | 381 ASSERT_TRUE(innerCompositor->inCompositingMode()); |
| 382 ASSERT_TRUE(innerCompositor->scrollLayer()); | 382 ASSERT_TRUE(innerCompositor->scrollLayer()); |
| 383 | 383 |
| 384 GraphicsLayer* scrollLayer = innerCompositor->scrollLayer(); | 384 GraphicsLayer* scrollLayer = innerCompositor->scrollLayer(); |
| 385 ASSERT_EQ(innerFrameView, scrollLayer->scrollableArea()); | 385 ASSERT_EQ(innerFrameView, scrollLayer->scrollableArea()); |
| 386 | 386 |
| 387 WebLayer* webScrollLayer = scrollLayer->platformLayer(); | 387 WebLayer* webScrollLayer = scrollLayer->platformLayer(); |
| 388 ASSERT_TRUE(webScrollLayer->scrollable()); | 388 ASSERT_TRUE(webScrollLayer->scrollable()); |
| 389 | 389 |
| 390 int expectedScrollPosition = 958 + (innerFrameView->verticalScrollbar()->isO
verlayScrollbar() ? 0 : 15); | 390 int expectedScrollPosition = 958 + (innerFrameView->verticalScrollbar()->isO
verlayScrollbar() ? 0 : 15); |
| 391 ASSERT_EQ(expectedScrollPosition, webScrollLayer->scrollPosition().x); | 391 ASSERT_EQ(expectedScrollPosition, webScrollLayer->scrollPosition().x); |
| 392 ASSERT_EQ(expectedScrollPosition, webScrollLayer->maxScrollPosition().width)
; | 392 ASSERT_EQ(expectedScrollPosition, webScrollLayer->maxScrollPosition().width)
; |
| 393 } | 393 } |
| 394 | 394 |
| 395 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) | 395 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) |
| 396 { | 396 { |
| 397 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); | 397 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); |
| 398 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); | 398 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); |
| 399 // This test document setup an iframe with scrollbars, then switch to | 399 // This test document setup an iframe with scrollbars, then switch to |
| 400 // an empty document by javascript. | 400 // an empty document by javascript. |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace | 403 } // namespace |
| OLD | NEW |