| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/layout/api/LayoutViewItem.h" | 29 #include "core/layout/api/LayoutViewItem.h" |
| 30 #include "core/layout/compositing/CompositedLayerMapping.h" | 30 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 31 #include "core/layout/compositing/PaintLayerCompositor.h" | 31 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 32 #include "core/page/Page.h" | 32 #include "core/page/Page.h" |
| 33 #include "platform/graphics/GraphicsLayer.h" | 33 #include "platform/graphics/GraphicsLayer.h" |
| 34 #include "platform/testing/URLTestHelpers.h" | 34 #include "platform/testing/URLTestHelpers.h" |
| 35 #include "public/platform/Platform.h" | 35 #include "public/platform/Platform.h" |
| 36 #include "public/platform/WebLayer.h" | 36 #include "public/platform/WebLayer.h" |
| 37 #include "public/platform/WebLayerPositionConstraint.h" | 37 #include "public/platform/WebLayerPositionConstraint.h" |
| 38 #include "public/platform/WebLayerTreeView.h" | 38 #include "public/platform/WebLayerTreeView.h" |
| 39 #include "public/platform/WebUnitTestSupport.h" | 39 #include "public/platform/WebURLLoaderMockFactory.h" |
| 40 #include "public/web/WebCache.h" |
| 40 #include "public/web/WebSettings.h" | 41 #include "public/web/WebSettings.h" |
| 41 #include "public/web/WebViewClient.h" | 42 #include "public/web/WebViewClient.h" |
| 42 #include "testing/gtest/include/gtest/gtest.h" | 43 #include "testing/gtest/include/gtest/gtest.h" |
| 43 #include "web/WebLocalFrameImpl.h" | 44 #include "web/WebLocalFrameImpl.h" |
| 44 #include "web/WebViewImpl.h" | 45 #include "web/WebViewImpl.h" |
| 45 #include "web/tests/FrameTestHelpers.h" | 46 #include "web/tests/FrameTestHelpers.h" |
| 46 | 47 |
| 47 namespace blink { | 48 namespace blink { |
| 48 | 49 |
| 49 class ScrollingCoordinatorTest : public testing::Test { | 50 class ScrollingCoordinatorTest : public testing::Test { |
| 50 public: | 51 public: |
| 51 ScrollingCoordinatorTest() | 52 ScrollingCoordinatorTest() |
| 52 : m_baseURL("http://www.test.com/") | 53 : m_baseURL("http://www.test.com/") |
| 53 { | 54 { |
| 54 m_helper.initialize(true, 0, &m_mockWebViewClient, &configureSettings); | 55 m_helper.initialize(true, 0, &m_mockWebViewClient, &configureSettings); |
| 55 webViewImpl()->resize(IntSize(320, 240)); | 56 webViewImpl()->resize(IntSize(320, 240)); |
| 56 | 57 |
| 57 // OSX attaches main frame scrollbars to the VisualViewport so the Visua
lViewport layers need | 58 // OSX attaches main frame scrollbars to the VisualViewport so the Visua
lViewport layers need |
| 58 // to be initialized. | 59 // to be initialized. |
| 59 webViewImpl()->updateAllLifecyclePhases(); | 60 webViewImpl()->updateAllLifecyclePhases(); |
| 60 webViewImpl()->setRootGraphicsLayer( | 61 webViewImpl()->setRootGraphicsLayer( |
| 61 webViewImpl()->mainFrameImpl()->frame()->view()->layoutView()->compo
sitor()->rootGraphicsLayer()); | 62 webViewImpl()->mainFrameImpl()->frame()->view()->layoutView()->compo
sitor()->rootGraphicsLayer()); |
| 62 } | 63 } |
| 63 | 64 |
| 64 ~ScrollingCoordinatorTest() override | 65 ~ScrollingCoordinatorTest() override |
| 65 { | 66 { |
| 66 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); | 67 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); |
| 68 WebCache::clear(); |
| 67 } | 69 } |
| 68 | 70 |
| 69 void navigateTo(const std::string& url) | 71 void navigateTo(const std::string& url) |
| 70 { | 72 { |
| 71 FrameTestHelpers::loadFrame(webViewImpl()->mainFrame(), url); | 73 FrameTestHelpers::loadFrame(webViewImpl()->mainFrame(), url); |
| 72 } | 74 } |
| 73 | 75 |
| 74 void forceFullCompositingUpdate() | 76 void forceFullCompositingUpdate() |
| 75 { | 77 { |
| 76 webViewImpl()->updateAllLifecyclePhases(); | 78 webViewImpl()->updateAllLifecyclePhases(); |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 EXPECT_FALSE(scrollLayer->shouldScrollOnMainThread()); | 624 EXPECT_FALSE(scrollLayer->shouldScrollOnMainThread()); |
| 623 | 625 |
| 624 fixedPos->setInlineStyleProperty(CSSPropertyTransform, CSSValueNone); | 626 fixedPos->setInlineStyleProperty(CSSPropertyTransform, CSSValueNone); |
| 625 forceFullCompositingUpdate(); | 627 forceFullCompositingUpdate(); |
| 626 | 628 |
| 627 EXPECT_FALSE(static_cast<LayoutBoxModelObject*>(fixedPos->layoutObject())->l
ayer()->hasCompositedLayerMapping()); | 629 EXPECT_FALSE(static_cast<LayoutBoxModelObject*>(fixedPos->layoutObject())->l
ayer()->hasCompositedLayerMapping()); |
| 628 EXPECT_TRUE(scrollLayer->shouldScrollOnMainThread()); | 630 EXPECT_TRUE(scrollLayer->shouldScrollOnMainThread()); |
| 629 } | 631 } |
| 630 | 632 |
| 631 } // namespace blink | 633 } // namespace blink |
| OLD | NEW |