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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "public/platform/WebUnitTestSupport.h" | 42 #include "public/platform/WebUnitTestSupport.h" |
43 #include "wtf/PassOwnPtr.h" | 43 #include "wtf/PassOwnPtr.h" |
44 #include <gtest/gtest.h> | 44 #include <gtest/gtest.h> |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 | 47 |
48 namespace { | 48 namespace { |
49 | 49 |
50 class MockGraphicsLayerClient : public GraphicsLayerClient { | 50 class MockGraphicsLayerClient : public GraphicsLayerClient { |
51 public: | 51 public: |
52 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain
tingPhase, const IntRect* inClip) const override { } | 52 IntRect computeInterestRect(const GraphicsLayer*, const IntRect&) const { re
turn IntRect(); } |
53 String debugName(const GraphicsLayer*) override { return String(); } | 53 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain
tingPhase, const IntRect&) const override { } |
| 54 String debugName(const GraphicsLayer*) const override { return String(); } |
54 }; | 55 }; |
55 | 56 |
56 class GraphicsLayerForTesting : public GraphicsLayer { | 57 class GraphicsLayerForTesting : public GraphicsLayer { |
57 public: | 58 public: |
58 explicit GraphicsLayerForTesting(GraphicsLayerClient* client) | 59 explicit GraphicsLayerForTesting(GraphicsLayerClient* client) |
59 : GraphicsLayer(client) { } | 60 : GraphicsLayer(client) { } |
60 }; | 61 }; |
61 | 62 |
62 } // anonymous namespace | 63 } // anonymous namespace |
63 | 64 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 232 |
232 WebDoublePoint scrollPosition(7, 9); | 233 WebDoublePoint scrollPosition(7, 9); |
233 m_platformLayer->setScrollPositionDouble(scrollPosition); | 234 m_platformLayer->setScrollPositionDouble(scrollPosition); |
234 m_graphicsLayer->didScroll(); | 235 m_graphicsLayer->didScroll(); |
235 | 236 |
236 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); | 237 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); |
237 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); | 238 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); |
238 } | 239 } |
239 | 240 |
240 } // namespace blink | 241 } // namespace blink |
OLD | NEW |