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 29 matching lines...) Expand all Loading... |
40 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PassOwnPtr.h" |
41 | 41 |
42 #include <gtest/gtest.h> | 42 #include <gtest/gtest.h> |
43 | 43 |
44 using namespace blink; | 44 using namespace blink; |
45 | 45 |
46 namespace { | 46 namespace { |
47 | 47 |
48 class MockGraphicsLayerClient : public GraphicsLayerClient { | 48 class MockGraphicsLayerClient : public GraphicsLayerClient { |
49 public: | 49 public: |
50 virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTi
me) override { } | |
51 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& inClip) override { } | 50 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& inClip) override { } |
52 virtual String debugName(const GraphicsLayer*) override { return String(); } | 51 virtual String debugName(const GraphicsLayer*) override { return String(); } |
53 }; | 52 }; |
54 | 53 |
55 class GraphicsLayerForTesting : public GraphicsLayer { | 54 class GraphicsLayerForTesting : public GraphicsLayer { |
56 public: | 55 public: |
57 explicit GraphicsLayerForTesting(GraphicsLayerClient* client) | 56 explicit GraphicsLayerForTesting(GraphicsLayerClient* client) |
58 : GraphicsLayer(client) { }; | 57 : GraphicsLayer(client) { }; |
59 | 58 |
60 virtual WebLayer* contentsLayer() const { return GraphicsLayer::contentsLaye
r(); } | 59 virtual WebLayer* contentsLayer() const { return GraphicsLayer::contentsLaye
r(); } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 160 |
162 WebDoublePoint scrollPosition(7.2, 9.6); | 161 WebDoublePoint scrollPosition(7.2, 9.6); |
163 m_platformLayer->setScrollPositionDouble(scrollPosition); | 162 m_platformLayer->setScrollPositionDouble(scrollPosition); |
164 m_graphicsLayer->didScroll(); | 163 m_graphicsLayer->didScroll(); |
165 | 164 |
166 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea.scrollPositionDouble().x())
; | 165 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea.scrollPositionDouble().x())
; |
167 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea.scrollPositionDouble().y())
; | 166 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea.scrollPositionDouble().y())
; |
168 } | 167 } |
169 | 168 |
170 } // namespace | 169 } // namespace |
OLD | NEW |