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

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

Issue 2680953002: Remove GraphicsLayer::didScroll and directly call ScrollableArea::didScroll (Closed)
Patch Set: Incorporate reviewer comments: more tests, less bad tests Created 3 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 RefPtr<WebTaskRunner> getTimerTaskRunner() const final { 197 RefPtr<WebTaskRunner> getTimerTaskRunner() const final {
198 return Platform::current()->currentThread()->scheduler()->timerTaskRunner(); 198 return Platform::current()->currentThread()->scheduler()->timerTaskRunner();
199 } 199 }
200 200
201 DEFINE_INLINE_VIRTUAL_TRACE() { ScrollableArea::trace(visitor); } 201 DEFINE_INLINE_VIRTUAL_TRACE() { ScrollableArea::trace(visitor); }
202 202
203 private: 203 private:
204 ScrollOffset m_scrollOffset; 204 ScrollOffset m_scrollOffset;
205 }; 205 };
206 206
207 TEST_F(GraphicsLayerTest, applyScrollToScrollableArea) {
208 FakeScrollableArea* scrollableArea = FakeScrollableArea::create();
209 m_graphicsLayer->setScrollableArea(scrollableArea, false);
210
211 WebDoublePoint scrollPosition(7, 9);
212 m_platformLayer->setScrollPositionDouble(scrollPosition);
213 m_graphicsLayer->didScroll();
214
215 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->getScrollOffset().width());
216 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->getScrollOffset().height());
217 }
218
219 } // namespace blink 207 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698