Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp

Issue 1860903002: Update Source/platform/ to assume Oilpan only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: back out ScrollAnimatorMac() accidental change Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 player.compositorPlayer()->detachLayer(); 154 player.compositorPlayer()->detachLayer();
155 ASSERT_FALSE(player.compositorPlayer()->isLayerAttached()); 155 ASSERT_FALSE(player.compositorPlayer()->isLayerAttached());
156 156
157 compositorTimeline->playerDestroyed(player); 157 compositorTimeline->playerDestroyed(player);
158 layerTreeView()->detachCompositorAnimationTimeline(compositorTimeline->anima tionTimeline()); 158 layerTreeView()->detachCompositorAnimationTimeline(compositorTimeline->anima tionTimeline());
159 } 159 }
160 160
161 class FakeScrollableArea : public GarbageCollectedFinalized<FakeScrollableArea>, public ScrollableArea { 161 class FakeScrollableArea : public GarbageCollectedFinalized<FakeScrollableArea>, public ScrollableArea {
162 USING_GARBAGE_COLLECTED_MIXIN(FakeScrollableArea); 162 USING_GARBAGE_COLLECTED_MIXIN(FakeScrollableArea);
163 public: 163 public:
164 static RawPtr<FakeScrollableArea> create() 164 static FakeScrollableArea* create()
165 { 165 {
166 return new FakeScrollableArea; 166 return new FakeScrollableArea;
167 } 167 }
168 168
169 LayoutRect visualRectForScrollbarParts() const override { return LayoutRect( ); } 169 LayoutRect visualRectForScrollbarParts() const override { return LayoutRect( ); }
170 bool isActive() const override { return false; } 170 bool isActive() const override { return false; }
171 int scrollSize(ScrollbarOrientation) const override { return 100; } 171 int scrollSize(ScrollbarOrientation) const override { return 100; }
172 bool isScrollCornerVisible() const override { return false; } 172 bool isScrollCornerVisible() const override { return false; }
173 IntRect scrollCornerRect() const override { return IntRect(); } 173 IntRect scrollCornerRect() const override { return IntRect(); }
174 int visibleWidth() const override { return 10; } 174 int visibleWidth() const override { return 10; }
(...skipping 19 matching lines...) Expand all
194 { 194 {
195 ScrollableArea::trace(visitor); 195 ScrollableArea::trace(visitor);
196 } 196 }
197 197
198 private: 198 private:
199 DoublePoint m_scrollPosition; 199 DoublePoint m_scrollPosition;
200 }; 200 };
201 201
202 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea) 202 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea)
203 { 203 {
204 RawPtr<FakeScrollableArea> scrollableArea = FakeScrollableArea::create(); 204 FakeScrollableArea* scrollableArea = FakeScrollableArea::create();
205 m_graphicsLayer->setScrollableArea(scrollableArea.get(), false); 205 m_graphicsLayer->setScrollableArea(scrollableArea, false);
206 206
207 WebDoublePoint scrollPosition(7, 9); 207 WebDoublePoint scrollPosition(7, 9);
208 m_platformLayer->setScrollPositionDouble(scrollPosition); 208 m_platformLayer->setScrollPositionDouble(scrollPosition);
209 m_graphicsLayer->didScroll(); 209 m_graphicsLayer->didScroll();
210 210
211 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x() ); 211 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x() );
212 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y() ); 212 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y() );
213 } 213 }
214 214
215 } // namespace blink 215 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698