| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 return 0; | 159 return 0; |
| 160 if (!layer->hasCompositedLayerMapping()) | 160 if (!layer->hasCompositedLayerMapping()) |
| 161 return 0; | 161 return 0; |
| 162 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi
ng(); | 162 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi
ng(); |
| 163 GraphicsLayer* graphicsLayer = compositedLayerMapping->mainGraphicsLayer(); | 163 GraphicsLayer* graphicsLayer = compositedLayerMapping->mainGraphicsLayer(); |
| 164 if (!graphicsLayer) | 164 if (!graphicsLayer) |
| 165 return 0; | 165 return 0; |
| 166 return graphicsLayer->platformLayer(); | 166 return graphicsLayer->platformLayer(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 TEST_F(ScrollingCoordinatorChromiumTest, fastFractionalScrollingFixedPosition) |
| 170 { |
| 171 registerMockedHttpURLLoad("fractional-scroll-fixed-position.html"); |
| 172 navigateTo(m_baseURL + "fractional-scroll-fixed-position.html"); |
| 173 FrameView* frameView = frame()->view(); |
| 174 frameView->scrollTo(DoublePoint(1.5, 1.5)); |
| 175 forceFullCompositingUpdate(); |
| 176 |
| 177 WebLayer* rootScrollLayer = getRootScrollLayer(); |
| 178 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); |
| 179 ASSERT_EQ(1.0, rootScrollLayer->scrollPositionDouble().x); |
| 180 ASSERT_EQ(1.0, rootScrollLayer->scrollPositionDouble().y); |
| 181 ASSERT_EQ(0.0, rootScrollLayer->position().x); |
| 182 ASSERT_EQ(0.0, rootScrollLayer->position().y); |
| 183 } |
| 184 |
| 185 TEST_F(ScrollingCoordinatorChromiumTest, fastFractionalScrollingFixedPositionHid
den) |
| 186 { |
| 187 registerMockedHttpURLLoad("fractional-scroll-fixed-position-hidden.html"); |
| 188 navigateTo(m_baseURL + "fractional-scroll-fixed-position-hidden.html"); |
| 189 FrameView* frameView = frame()->view(); |
| 190 frameView->scrollTo(DoublePoint(1.5, 1.5)); |
| 191 forceFullCompositingUpdate(); |
| 192 |
| 193 WebLayer* rootScrollLayer = getRootScrollLayer(); |
| 194 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); |
| 195 ASSERT_EQ(1.5, rootScrollLayer->scrollPositionDouble().x); |
| 196 ASSERT_EQ(1.5, rootScrollLayer->scrollPositionDouble().y); |
| 197 ASSERT_EQ(0.0, rootScrollLayer->position().x); |
| 198 ASSERT_EQ(0.0, rootScrollLayer->position().y); |
| 199 } |
| 200 |
| 169 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingForFixedPosition) | 201 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingForFixedPosition) |
| 170 { | 202 { |
| 171 registerMockedHttpURLLoad("fixed-position.html"); | 203 registerMockedHttpURLLoad("fixed-position.html"); |
| 172 navigateTo(m_baseURL + "fixed-position.html"); | 204 navigateTo(m_baseURL + "fixed-position.html"); |
| 173 forceFullCompositingUpdate(); | 205 forceFullCompositingUpdate(); |
| 174 | 206 |
| 175 // Fixed position should not fall back to main thread scrolling. | 207 // Fixed position should not fall back to main thread scrolling. |
| 176 WebLayer* rootScrollLayer = getRootScrollLayer(); | 208 WebLayer* rootScrollLayer = getRootScrollLayer(); |
| 177 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); | 209 ASSERT_FALSE(rootScrollLayer->shouldScrollOnMainThread()); |
| 178 | 210 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 WebLayer* contentsLayer = scrollbarGraphicsLayer->contentsLayer(); | 533 WebLayer* contentsLayer = scrollbarGraphicsLayer->contentsLayer(); |
| 502 ASSERT_TRUE(contentsLayer); | 534 ASSERT_TRUE(contentsLayer); |
| 503 | 535 |
| 504 // After scrollableAreaScrollbarLayerDidChange, | 536 // After scrollableAreaScrollbarLayerDidChange, |
| 505 // if the main frame's scrollbarLayer is opaque, | 537 // if the main frame's scrollbarLayer is opaque, |
| 506 // contentsLayer should be opaque too. | 538 // contentsLayer should be opaque too. |
| 507 ASSERT_EQ(platformLayer->opaque(), contentsLayer->opaque()); | 539 ASSERT_EQ(platformLayer->opaque(), contentsLayer->opaque()); |
| 508 } | 540 } |
| 509 | 541 |
| 510 } // namespace | 542 } // namespace |
| OLD | NEW |