OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "platform/scroll/ScrollAnimatorNone.h" | 30 #include "platform/scroll/ScrollAnimatorNone.h" |
31 | 31 |
32 #include "platform/Logging.h" | 32 #include "platform/Logging.h" |
33 #include "platform/geometry/FloatPoint.h" | 33 #include "platform/geometry/FloatPoint.h" |
34 #include "platform/geometry/IntRect.h" | 34 #include "platform/geometry/IntRect.h" |
35 #include "platform/scroll/ScrollAnimator.h" | 35 #include "platform/scroll/ScrollAnimator.h" |
36 #include "platform/scroll/ScrollableArea.h" | 36 #include "platform/scroll/ScrollableArea.h" |
37 #include <gmock/gmock.h> | 37 #include <gmock/gmock.h> |
38 #include <gtest/gtest.h> | 38 #include <gtest/gtest.h> |
39 | 39 |
40 using namespace WebCore; | 40 using namespace blink; |
41 | 41 |
42 using testing::AtLeast; | 42 using testing::AtLeast; |
43 using testing::Return; | 43 using testing::Return; |
44 using testing::_; | 44 using testing::_; |
45 | 45 |
46 class MockScrollableArea : public ScrollableArea { | 46 class MockScrollableArea : public ScrollableArea { |
47 public: | 47 public: |
48 MockScrollableArea(bool scrollAnimatorEnabled) | 48 MockScrollableArea(bool scrollAnimatorEnabled) |
49 : m_scrollAnimatorEnabled(scrollAnimatorEnabled) { } | 49 : m_scrollAnimatorEnabled(scrollAnimatorEnabled) { } |
50 | 50 |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 EXPECT_TRUE(result); | 1043 EXPECT_TRUE(result); |
1044 result = result && animateScroll(t); | 1044 result = result && animateScroll(t); |
1045 double after = m_currentPosition; | 1045 double after = m_currentPosition; |
1046 EXPECT_GE(before, after); | 1046 EXPECT_GE(before, after); |
1047 | 1047 |
1048 t += kAnimationTime; | 1048 t += kAnimationTime; |
1049 for (; result && t < kEndTime; t += kAnimationTime) | 1049 for (; result && t < kEndTime; t += kAnimationTime) |
1050 result = result && animateScroll(t); | 1050 result = result && animateScroll(t); |
1051 EXPECT_GE(before, m_currentPosition); | 1051 EXPECT_GE(before, m_currentPosition); |
1052 } | 1052 } |
OLD | NEW |