| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting()); | 156 ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting()); |
| 157 | 157 |
| 158 player.compositorPlayer()->detachLayer(); | 158 player.compositorPlayer()->detachLayer(); |
| 159 ASSERT_FALSE(player.compositorPlayer()->isLayerAttached()); | 159 ASSERT_FALSE(player.compositorPlayer()->isLayerAttached()); |
| 160 | 160 |
| 161 compositorTimeline->playerDestroyed(player); | 161 compositorTimeline->playerDestroyed(player); |
| 162 layerTreeView()->detachCompositorAnimationTimeline(compositorTimeline->anima
tionTimeline()); | 162 layerTreeView()->detachCompositorAnimationTimeline(compositorTimeline->anima
tionTimeline()); |
| 163 } | 163 } |
| 164 | 164 |
| 165 class FakeScrollableArea : public NoBaseWillBeGarbageCollectedFinalized<FakeScro
llableArea>, public ScrollableArea { | 165 class FakeScrollableArea : public GarbageCollectedFinalized<FakeScrollableArea>,
public ScrollableArea { |
| 166 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FakeScrollableArea); | 166 USING_GARBAGE_COLLECTED_MIXIN(FakeScrollableArea); |
| 167 public: | 167 public: |
| 168 static PassOwnPtrWillBeRawPtr<FakeScrollableArea> create() | 168 static RawPtr<FakeScrollableArea> create() |
| 169 { | 169 { |
| 170 return adoptPtrWillBeNoop(new FakeScrollableArea); | 170 return adoptPtrWillBeNoop(new FakeScrollableArea); |
| 171 } | 171 } |
| 172 | 172 |
| 173 LayoutRect visualRectForScrollbarParts() const override { return LayoutRect(
); } | 173 LayoutRect visualRectForScrollbarParts() const override { return LayoutRect(
); } |
| 174 bool isActive() const override { return false; } | 174 bool isActive() const override { return false; } |
| 175 int scrollSize(ScrollbarOrientation) const override { return 100; } | 175 int scrollSize(ScrollbarOrientation) const override { return 100; } |
| 176 bool isScrollCornerVisible() const override { return false; } | 176 bool isScrollCornerVisible() const override { return false; } |
| 177 IntRect scrollCornerRect() const override { return IntRect(); } | 177 IntRect scrollCornerRect() const override { return IntRect(); } |
| 178 int visibleWidth() const override { return 10; } | 178 int visibleWidth() const override { return 10; } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 198 { | 198 { |
| 199 ScrollableArea::trace(visitor); | 199 ScrollableArea::trace(visitor); |
| 200 } | 200 } |
| 201 | 201 |
| 202 private: | 202 private: |
| 203 DoublePoint m_scrollPosition; | 203 DoublePoint m_scrollPosition; |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea) | 206 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea) |
| 207 { | 207 { |
| 208 OwnPtrWillBeRawPtr<FakeScrollableArea> scrollableArea = FakeScrollableArea::
create(); | 208 RawPtr<FakeScrollableArea> scrollableArea = FakeScrollableArea::create(); |
| 209 m_graphicsLayer->setScrollableArea(scrollableArea.get(), false); | 209 m_graphicsLayer->setScrollableArea(scrollableArea.get(), false); |
| 210 | 210 |
| 211 WebDoublePoint scrollPosition(7, 9); | 211 WebDoublePoint scrollPosition(7, 9); |
| 212 m_platformLayer->setScrollPositionDouble(scrollPosition); | 212 m_platformLayer->setScrollPositionDouble(scrollPosition); |
| 213 m_graphicsLayer->didScroll(); | 213 m_graphicsLayer->didScroll(); |
| 214 | 214 |
| 215 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); | 215 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); |
| 216 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); | 216 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace blink | 219 } // namespace blink |
| OLD | NEW |