| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 settings->setAcceleratedCompositingForFixedPositionEnabled(true); | 122 settings->setAcceleratedCompositingForFixedPositionEnabled(true); |
| 123 settings->setAcceleratedCompositingForOverflowScrollEnabled(true); | 123 settings->setAcceleratedCompositingForOverflowScrollEnabled(true); |
| 124 settings->setAcceleratedCompositingForScrollableFramesEnabled(true); | 124 settings->setAcceleratedCompositingForScrollableFramesEnabled(true); |
| 125 settings->setCompositedScrollingForFramesEnabled(true); | 125 settings->setCompositedScrollingForFramesEnabled(true); |
| 126 settings->setFixedPositionCreatesStackingContext(true); | 126 settings->setFixedPositionCreatesStackingContext(true); |
| 127 } | 127 } |
| 128 | 128 |
| 129 FrameTestHelpers::WebViewHelper m_helper; | 129 FrameTestHelpers::WebViewHelper m_helper; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefault) | 132 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefaultBodyNotScrollable
) |
| 133 { | 133 { |
| 134 navigateTo("about:blank"); | 134 navigateTo("about:blank"); |
| 135 forceFullCompositingUpdate(); | 135 forceFullCompositingUpdate(); |
| 136 | 136 |
| 137 // Make sure the scrolling coordinator is active. | 137 // Make sure the scrolling coordinator is active. |
| 138 FrameView* frameView = frame()->view(); | 138 FrameView* frameView = frame()->view(); |
| 139 Page* page = frame()->page(); | 139 Page* page = frame()->page(); |
| 140 ASSERT_TRUE(page->scrollingCoordinator()); | 140 ASSERT_TRUE(page->scrollingCoordinator()); |
| 141 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f
rameView)); | 141 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f
rameView)); |
| 142 | 142 |
| 143 // Fast scrolling should be enabled by default, BUT if the main frame is |
| 144 // not scrollable, then the rootScrollLayer shouldn't be scrollable either. |
| 145 WebLayer* rootScrollLayer = getRootScrollLayer(); |
| 146 ASSERT_FALSE(rootScrollLayer->scrollable()); |
| 147 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); |
| 148 ASSERT_FALSE(rootScrollLayer->haveWheelEventHandlers()); |
| 149 } |
| 150 |
| 151 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefaultBodyScrollable) |
| 152 { |
| 153 registerMockedHttpURLLoad("body-overflow-visible.html"); |
| 154 navigateTo(m_baseURL + "body-overflow-visible.html"); |
| 155 forceFullCompositingUpdate(); |
| 156 |
| 157 // Make sure the scrolling coordinator is active. |
| 158 FrameView* frameView = frame()->view(); |
| 159 Page* page = frame()->page(); |
| 160 ASSERT_TRUE(page->scrollingCoordinator()); |
| 161 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f
rameView)); |
| 162 |
| 143 // Fast scrolling should be enabled by default. | 163 // Fast scrolling should be enabled by default. |
| 144 WebLayer* rootScrollLayer = getRootScrollLayer(); | 164 WebLayer* rootScrollLayer = getRootScrollLayer(); |
| 145 ASSERT_TRUE(rootScrollLayer->scrollable()); | 165 ASSERT_TRUE(rootScrollLayer->scrollable()); |
| 146 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); | 166 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); |
| 147 ASSERT_FALSE(rootScrollLayer->haveWheelEventHandlers()); | 167 ASSERT_FALSE(rootScrollLayer->haveWheelEventHandlers()); |
| 148 } | 168 } |
| 149 | 169 |
| 150 static WebLayer* webLayerFromElement(Element* element) | 170 static WebLayer* webLayerFromElement(Element* element) |
| 151 { | 171 { |
| 152 if (!element) | 172 if (!element) |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) | 486 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) |
| 467 { | 487 { |
| 468 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); | 488 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); |
| 469 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); | 489 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); |
| 470 forceFullCompositingUpdate(); | 490 forceFullCompositingUpdate(); |
| 471 // This test document setup an iframe with scrollbars, then switch to | 491 // This test document setup an iframe with scrollbars, then switch to |
| 472 // an empty document by javascript. | 492 // an empty document by javascript. |
| 473 } | 493 } |
| 474 | 494 |
| 475 } // namespace | 495 } // namespace |
| OLD | NEW |