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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 m_graphicsLayer->setShouldFlattenTransform(true); 176 m_graphicsLayer->setShouldFlattenTransform(true);
177 177
178 m_platformLayer = m_graphicsLayer->platformLayer(); 178 m_platformLayer = m_graphicsLayer->platformLayer();
179 ASSERT_TRUE(m_platformLayer); 179 ASSERT_TRUE(m_platformLayer);
180 180
181 ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); 181 ASSERT_FALSE(m_platformLayer->hasActiveAnimation());
182 } 182 }
183 } 183 }
184 184
185 class FakeScrollableArea : public NoBaseWillBeGarbageCollectedFinalized<FakeScro llableArea>, public ScrollableArea { 185 class FakeScrollableArea : public GarbageCollectedFinalized<FakeScrollableArea>, public ScrollableArea {
186 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FakeScrollableArea); 186 USING_GARBAGE_COLLECTED_MIXIN(FakeScrollableArea);
187 public: 187 public:
188 static PassOwnPtrWillBeRawPtr<FakeScrollableArea> create() 188 static RawPtr<FakeScrollableArea> create()
189 { 189 {
190 return adoptPtrWillBeNoop(new FakeScrollableArea); 190 return (new FakeScrollableArea);
191 } 191 }
192 192
193 bool isActive() const override { return false; } 193 bool isActive() const override { return false; }
194 int scrollSize(ScrollbarOrientation) const override { return 100; } 194 int scrollSize(ScrollbarOrientation) const override { return 100; }
195 bool isScrollCornerVisible() const override { return false; } 195 bool isScrollCornerVisible() const override { return false; }
196 IntRect scrollCornerRect() const override { return IntRect(); } 196 IntRect scrollCornerRect() const override { return IntRect(); }
197 int visibleWidth() const override { return 10; } 197 int visibleWidth() const override { return 10; }
198 int visibleHeight() const override { return 10; } 198 int visibleHeight() const override { return 10; }
199 IntSize contentsSize() const override { return IntSize(100, 100); } 199 IntSize contentsSize() const override { return IntSize(100, 100); }
200 bool scrollbarsCanBeActive() const override { return false; } 200 bool scrollbarsCanBeActive() const override { return false; }
(...skipping 17 matching lines...) Expand all
218 { 218 {
219 ScrollableArea::trace(visitor); 219 ScrollableArea::trace(visitor);
220 } 220 }
221 221
222 private: 222 private:
223 DoublePoint m_scrollPosition; 223 DoublePoint m_scrollPosition;
224 }; 224 };
225 225
226 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea) 226 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea)
227 { 227 {
228 OwnPtrWillBeRawPtr<FakeScrollableArea> scrollableArea = FakeScrollableArea:: create(); 228 RawPtr<FakeScrollableArea> scrollableArea = FakeScrollableArea::create();
229 m_graphicsLayer->setScrollableArea(scrollableArea.get(), false); 229 m_graphicsLayer->setScrollableArea(scrollableArea.get(), false);
230 230
231 WebDoublePoint scrollPosition(7, 9); 231 WebDoublePoint scrollPosition(7, 9);
232 m_platformLayer->setScrollPositionDouble(scrollPosition); 232 m_platformLayer->setScrollPositionDouble(scrollPosition);
233 m_graphicsLayer->didScroll(); 233 m_graphicsLayer->didScroll();
234 234
235 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x() ); 235 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x() );
236 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y() ); 236 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y() );
237 } 237 }
238 238
239 } // namespace blink 239 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698