OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.os.Bundle; | 8 import android.os.Bundle; |
9 import android.os.SystemClock; | 9 import android.os.SystemClock; |
10 import android.test.InstrumentationTestCase; | 10 import android.test.InstrumentationTestCase; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 @Override | 110 @Override |
111 public boolean didUIStealScroll(float x, float y) { | 111 public boolean didUIStealScroll(float x, float y) { |
112 // Not implemented. | 112 // Not implemented. |
113 return false; | 113 return false; |
114 } | 114 } |
115 | 115 |
116 @Override | 116 @Override |
117 public void invokeZoomPicker() { | 117 public void invokeZoomPicker() { |
118 // Not implemented. | 118 // Not implemented. |
119 } | 119 } |
| 120 |
| 121 @Override |
| 122 public boolean hasFixedPageScale() { |
| 123 return false; |
| 124 } |
120 } | 125 } |
121 | 126 |
122 static class MockZoomManager extends ZoomManager { | 127 static class MockZoomManager extends ZoomManager { |
123 MockZoomManager(Context context, ContentViewCore contentViewCore) { | 128 MockZoomManager(Context context, ContentViewCore contentViewCore) { |
124 super(context, contentViewCore); | 129 super(context, contentViewCore); |
125 } | 130 } |
126 | 131 |
127 @Override | 132 @Override |
128 public boolean processTouchEvent(MotionEvent event) { | 133 public boolean processTouchEvent(MotionEvent event) { |
129 return false; | 134 return false; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 public boolean didUIStealScroll(float x, float y) { | 268 public boolean didUIStealScroll(float x, float y) { |
264 // Not implemented. | 269 // Not implemented. |
265 return false; | 270 return false; |
266 } | 271 } |
267 | 272 |
268 @Override | 273 @Override |
269 public void invokeZoomPicker() { | 274 public void invokeZoomPicker() { |
270 // Not implemented. | 275 // Not implemented. |
271 } | 276 } |
272 | 277 |
| 278 @Override |
| 279 public boolean hasFixedPageScale() { |
| 280 return false; |
| 281 } |
| 282 |
273 public GestureEvent getMostRecentGestureEvent() { | 283 public GestureEvent getMostRecentGestureEvent() { |
274 return mMostRecentGestureEvent; | 284 return mMostRecentGestureEvent; |
275 } | 285 } |
276 } | 286 } |
277 | 287 |
278 /** | 288 /** |
279 * Generate a scroll gesture and verify that the resulting scroll motion eve
nt has both absolute | 289 * Generate a scroll gesture and verify that the resulting scroll motion eve
nt has both absolute |
280 * and relative position information. | 290 * and relative position information. |
281 */ | 291 */ |
282 @SmallTest | 292 @SmallTest |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 assertEquals(FAKE_COORD_X - deltaX, gestureEvent.getX()); | 325 assertEquals(FAKE_COORD_X - deltaX, gestureEvent.getX()); |
316 assertEquals(FAKE_COORD_Y - deltaY, gestureEvent.getY()); | 326 assertEquals(FAKE_COORD_Y - deltaY, gestureEvent.getY()); |
317 | 327 |
318 Bundle extraParams = gestureEvent.getExtraParams(); | 328 Bundle extraParams = gestureEvent.getExtraParams(); |
319 assertNotNull(extraParams); | 329 assertNotNull(extraParams); |
320 // No horizontal delta because of snapping. | 330 // No horizontal delta because of snapping. |
321 assertEquals(0, extraParams.getInt(ContentViewGestureHandler.DISTANCE_X)
); | 331 assertEquals(0, extraParams.getInt(ContentViewGestureHandler.DISTANCE_X)
); |
322 assertEquals(deltaY / 2, extraParams.getInt(ContentViewGestureHandler.DI
STANCE_Y)); | 332 assertEquals(deltaY / 2, extraParams.getInt(ContentViewGestureHandler.DI
STANCE_Y)); |
323 } | 333 } |
324 } | 334 } |
OLD | NEW |