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 28 matching lines...) Expand all Loading... |
39 #include "wtf/PassOwnPtr.h" | 39 #include "wtf/PassOwnPtr.h" |
40 #include <gtest/gtest.h> | 40 #include <gtest/gtest.h> |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 class MockGraphicsLayerClient : public GraphicsLayerClient { | 46 class MockGraphicsLayerClient : public GraphicsLayerClient { |
47 public: | 47 public: |
48 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain
tingPhase, const IntRect& inClip) const override { } | 48 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain
tingPhase, const IntRect& inClip) const override { } |
| 49 void paintContentsIfNeeded(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase) const override { } |
49 String debugName(const GraphicsLayer*) override { return String(); } | 50 String debugName(const GraphicsLayer*) override { return String(); } |
50 }; | 51 }; |
51 | 52 |
52 class GraphicsLayerForTesting : public GraphicsLayer { | 53 class GraphicsLayerForTesting : public GraphicsLayer { |
53 public: | 54 public: |
54 explicit GraphicsLayerForTesting(GraphicsLayerClient* client) | 55 explicit GraphicsLayerForTesting(GraphicsLayerClient* client) |
55 : GraphicsLayer(client) { } | 56 : GraphicsLayer(client) { } |
56 | 57 |
57 WebLayer* contentsLayer() const override { return GraphicsLayer::contentsLay
er(); } | 58 WebLayer* contentsLayer() const override { return GraphicsLayer::contentsLay
er(); } |
58 }; | 59 }; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 175 |
175 WebDoublePoint scrollPosition(7, 9); | 176 WebDoublePoint scrollPosition(7, 9); |
176 m_platformLayer->setScrollPositionDouble(scrollPosition); | 177 m_platformLayer->setScrollPositionDouble(scrollPosition); |
177 m_graphicsLayer->didScroll(); | 178 m_graphicsLayer->didScroll(); |
178 | 179 |
179 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); | 180 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); |
180 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); | 181 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); |
181 } | 182 } |
182 | 183 |
183 } // namespace blink | 184 } // namespace blink |
OLD | NEW |