Chromium Code Reviews| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 static void configureSettings(WebSettings* settings) | 99 static void configureSettings(WebSettings* settings) |
| 100 { | 100 { |
| 101 settings->setJavaScriptEnabled(true); | 101 settings->setJavaScriptEnabled(true); |
| 102 settings->setAcceleratedCompositingEnabled(true); | 102 settings->setAcceleratedCompositingEnabled(true); |
| 103 settings->setPreferCompositingToLCDTextEnabled(true); | 103 settings->setPreferCompositingToLCDTextEnabled(true); |
| 104 } | 104 } |
| 105 | 105 |
| 106 FrameTestHelpers::WebViewHelper m_helper; | 106 FrameTestHelpers::WebViewHelper m_helper; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 class GraphicsLayerForScrollTesting : public GraphicsLayer { | |
| 110 public: | |
| 111 virtual WebLayer* contentsLayer() const { return GraphicsLayer::contentsLaye r(); } | |
| 112 }; | |
| 113 | |
| 109 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefault) | 114 TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefault) |
| 110 { | 115 { |
| 111 navigateTo("about:blank"); | 116 navigateTo("about:blank"); |
| 112 forceFullCompositingUpdate(); | 117 forceFullCompositingUpdate(); |
| 113 | 118 |
| 114 // Make sure the scrolling coordinator is active. | 119 // Make sure the scrolling coordinator is active. |
| 115 FrameView* frameView = frame()->view(); | 120 FrameView* frameView = frame()->view(); |
| 116 Page* page = frame()->page(); | 121 Page* page = frame()->page(); |
| 117 ASSERT_TRUE(page->scrollingCoordinator()); | 122 ASSERT_TRUE(page->scrollingCoordinator()); |
| 118 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f rameView)); | 123 ASSERT_TRUE(page->scrollingCoordinator()->coordinatesScrollingForFrameView(f rameView)); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 467 | 472 |
| 468 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) | 473 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) |
| 469 { | 474 { |
| 470 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); | 475 registerMockedHttpURLLoad("setup_scrollbar_layer_crash.html"); |
| 471 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); | 476 navigateTo(m_baseURL + "setup_scrollbar_layer_crash.html"); |
| 472 forceFullCompositingUpdate(); | 477 forceFullCompositingUpdate(); |
| 473 // This test document setup an iframe with scrollbars, then switch to | 478 // This test document setup an iframe with scrollbars, then switch to |
| 474 // an empty document by javascript. | 479 // an empty document by javascript. |
| 475 } | 480 } |
| 476 | 481 |
| 482 TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldSetScrollLayer Opaque) | |
| 483 { | |
| 484 registerMockedHttpURLLoad("wide_document.html"); | |
| 485 navigateTo(m_baseURL + "wide_document.html"); | |
| 486 forceFullCompositingUpdate(); | |
| 487 | |
| 488 FrameView* frameView = frame()->view(); | |
| 489 ASSERT_TRUE(frameView); | |
| 490 | |
| 491 GraphicsLayerForScrollTesting* scrollbarGraphicsLayer = static_cast<Graphics LayerForScrollTesting*>(frameView->layerForHorizontalScrollbar()); | |
| 492 ASSERT_TRUE(scrollbarGraphicsLayer); | |
| 493 | |
| 494 WebLayer* platformLayer = scrollbarGraphicsLayer->platformLayer(); | |
| 495 ASSERT_TRUE(platformLayer); | |
| 496 | |
| 497 WebLayer* contentsLayer = scrollbarGraphicsLayer->contentsLayer(); | |
| 498 ASSERT_TRUE(contentsLayer); | |
| 499 | |
| 500 // after scrollableAreaScrollbarLayerDidChange, | |
|
enne (OOO)
2014/10/13 21:34:00
Tiny nit: capitalize the 'A' in 'After', since it'
| |
| 501 // if the main frame's scrollbarLayer is opaque, | |
| 502 // contentsLayer should be opaque too. | |
| 503 ASSERT_EQ(platformLayer->opaque(), contentsLayer->opaque()); | |
| 504 } | |
| 505 | |
| 477 } // namespace | 506 } // namespace |
| OLD | NEW |