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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |