| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "public/platform/WebLayerTreeView.h" | 46 #include "public/platform/WebLayerTreeView.h" |
| 47 #include "testing/gtest/include/gtest/gtest.h" | 47 #include "testing/gtest/include/gtest/gtest.h" |
| 48 #include "wtf/PtrUtil.h" | 48 #include "wtf/PtrUtil.h" |
| 49 #include <memory> | 49 #include <memory> |
| 50 | 50 |
| 51 namespace blink { | 51 namespace blink { |
| 52 | 52 |
| 53 class GraphicsLayerTest : public testing::Test { | 53 class GraphicsLayerTest : public testing::Test { |
| 54 public: | 54 public: |
| 55 GraphicsLayerTest() { | 55 GraphicsLayerTest() { |
| 56 m_clipLayer = wrapUnique(new FakeGraphicsLayer(&m_client)); | 56 m_clipLayer = WTF::wrapUnique(new FakeGraphicsLayer(&m_client)); |
| 57 m_scrollElasticityLayer = wrapUnique(new FakeGraphicsLayer(&m_client)); | 57 m_scrollElasticityLayer = WTF::wrapUnique(new FakeGraphicsLayer(&m_client)); |
| 58 m_graphicsLayer = wrapUnique(new FakeGraphicsLayer(&m_client)); | 58 m_graphicsLayer = WTF::wrapUnique(new FakeGraphicsLayer(&m_client)); |
| 59 m_clipLayer->addChild(m_scrollElasticityLayer.get()); | 59 m_clipLayer->addChild(m_scrollElasticityLayer.get()); |
| 60 m_scrollElasticityLayer->addChild(m_graphicsLayer.get()); | 60 m_scrollElasticityLayer->addChild(m_graphicsLayer.get()); |
| 61 m_graphicsLayer->platformLayer()->setScrollClipLayer( | 61 m_graphicsLayer->platformLayer()->setScrollClipLayer( |
| 62 m_clipLayer->platformLayer()); | 62 m_clipLayer->platformLayer()); |
| 63 m_platformLayer = m_graphicsLayer->platformLayer(); | 63 m_platformLayer = m_graphicsLayer->platformLayer(); |
| 64 m_layerTreeView = wrapUnique(new WebLayerTreeViewImplForTesting); | 64 m_layerTreeView = WTF::wrapUnique(new WebLayerTreeViewImplForTesting); |
| 65 ASSERT(m_layerTreeView); | 65 ASSERT(m_layerTreeView); |
| 66 m_layerTreeView->setRootLayer(*m_clipLayer->platformLayer()); | 66 m_layerTreeView->setRootLayer(*m_clipLayer->platformLayer()); |
| 67 m_layerTreeView->registerViewportLayers( | 67 m_layerTreeView->registerViewportLayers( |
| 68 m_scrollElasticityLayer->platformLayer(), m_clipLayer->platformLayer(), | 68 m_scrollElasticityLayer->platformLayer(), m_clipLayer->platformLayer(), |
| 69 m_graphicsLayer->platformLayer(), 0); | 69 m_graphicsLayer->platformLayer(), 0); |
| 70 m_layerTreeView->setViewportSize(WebSize(1, 1)); | 70 m_layerTreeView->setViewportSize(WebSize(1, 1)); |
| 71 } | 71 } |
| 72 | 72 |
| 73 ~GraphicsLayerTest() override { | 73 ~GraphicsLayerTest() override { |
| 74 m_graphicsLayer.reset(); | 74 m_graphicsLayer.reset(); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 WebDoublePoint scrollPosition(7, 9); | 204 WebDoublePoint scrollPosition(7, 9); |
| 205 m_platformLayer->setScrollPositionDouble(scrollPosition); | 205 m_platformLayer->setScrollPositionDouble(scrollPosition); |
| 206 m_graphicsLayer->didScroll(); | 206 m_graphicsLayer->didScroll(); |
| 207 | 207 |
| 208 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->getScrollOffset().width()); | 208 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->getScrollOffset().width()); |
| 209 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->getScrollOffset().height()); | 209 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->getScrollOffset().height()); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace blink | 212 } // namespace blink |
| OLD | NEW |