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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 ~WebCompositorAnimationMock() { delete_(); } | 102 ~WebCompositorAnimationMock() { delete_(); } |
103 }; | 103 }; |
104 | 104 |
105 template<typename CurveType, WebCompositorAnimationCurve::AnimationCurveType Cur
veId, typename KeyframeType> | 105 template<typename CurveType, WebCompositorAnimationCurve::AnimationCurveType Cur
veId, typename KeyframeType> |
106 class WebCompositorAnimationCurveMock : public CurveType { | 106 class WebCompositorAnimationCurveMock : public CurveType { |
107 public: | 107 public: |
108 MOCK_METHOD1_T(add, void(const KeyframeType&)); | 108 MOCK_METHOD1_T(add, void(const KeyframeType&)); |
109 MOCK_METHOD2_T(add, void(const KeyframeType&, WebCompositorAnimationCurve::T
imingFunctionType)); | 109 MOCK_METHOD2_T(add, void(const KeyframeType&, WebCompositorAnimationCurve::T
imingFunctionType)); |
110 MOCK_METHOD5_T(add, void(const KeyframeType&, double, double, double, double
)); | 110 MOCK_METHOD5_T(add, void(const KeyframeType&, double, double, double, double
)); |
111 | 111 |
112 MOCK_METHOD4(setTimingFunction, void(double, double, double, double)); | |
113 MOCK_METHOD1(setTimingFunction, void(WebCompositorAnimationCurve::TimingFunc
tionType)); | |
114 | |
115 MOCK_CONST_METHOD1_T(getValue, float(double)); // Only on WebFloatAnimationC
urve, but can't hurt to have here. | 112 MOCK_CONST_METHOD1_T(getValue, float(double)); // Only on WebFloatAnimationC
urve, but can't hurt to have here. |
116 | 113 |
117 virtual WebCompositorAnimationCurve::AnimationCurveType type() const { retur
n CurveId; }; | 114 virtual WebCompositorAnimationCurve::AnimationCurveType type() const { retur
n CurveId; }; |
118 | 115 |
119 MOCK_METHOD0(delete_, void()); | 116 MOCK_METHOD0(delete_, void()); |
120 ~WebCompositorAnimationCurveMock() { delete_(); } | 117 ~WebCompositorAnimationCurveMock() { delete_(); } |
121 }; | 118 }; |
122 | 119 |
123 using WebFloatAnimationCurveMock = WebCompositorAnimationCurveMock<WebFloatAnima
tionCurve, WebCompositorAnimationCurve::AnimationCurveTypeFloat, WebFloatKeyfram
e>; | 120 using WebFloatAnimationCurveMock = WebCompositorAnimationCurveMock<WebFloatAnima
tionCurve, WebCompositorAnimationCurve::AnimationCurveTypeFloat, WebFloatKeyfram
e>; |
124 | 121 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 void setCompositorForTesting(WebCompositorSupportMock& mock) | 165 void setCompositorForTesting(WebCompositorSupportMock& mock) |
169 { | 166 { |
170 ASSERT(!m_mockCompositor); | 167 ASSERT(!m_mockCompositor); |
171 m_mockCompositor = &mock; | 168 m_mockCompositor = &mock; |
172 } | 169 } |
173 }; | 170 }; |
174 | 171 |
175 } | 172 } |
176 | 173 |
177 #endif | 174 #endif |
OLD | NEW |