OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.android_webview.test; | 5 package org.chromium.android_webview.test; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.os.Build; | 8 import android.os.Build; |
9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
10 import android.view.View; | 10 import android.view.View; |
11 import android.widget.OverScroller; | 11 import android.widget.OverScroller; |
12 | 12 |
13 import org.chromium.android_webview.AwContents; | 13 import org.chromium.android_webview.AwContents; |
14 import org.chromium.android_webview.AwScrollOffsetManager; | 14 import org.chromium.android_webview.AwScrollOffsetManager; |
15 import org.chromium.android_webview.test.util.AwTestTouchUtils; | 15 import org.chromium.android_webview.test.util.AwTestTouchUtils; |
16 import org.chromium.android_webview.test.util.CommonResources; | 16 import org.chromium.android_webview.test.util.CommonResources; |
17 import org.chromium.android_webview.test.util.JavascriptEventObserver; | 17 import org.chromium.android_webview.test.util.JavascriptEventObserver; |
| 18 import org.chromium.base.annotations.SuppressFBWarnings; |
18 import org.chromium.base.test.util.Feature; | 19 import org.chromium.base.test.util.Feature; |
19 import org.chromium.base.test.util.MinAndroidSdkLevel; | 20 import org.chromium.base.test.util.MinAndroidSdkLevel; |
20 import org.chromium.content.browser.test.util.CallbackHelper; | 21 import org.chromium.content.browser.test.util.CallbackHelper; |
21 import org.chromium.content_public.browser.GestureStateListener; | 22 import org.chromium.content_public.browser.GestureStateListener; |
22 import org.chromium.ui.gfx.DeviceDisplayInfo; | 23 import org.chromium.ui.gfx.DeviceDisplayInfo; |
23 | 24 |
24 import java.util.Locale; | 25 import java.util.Locale; |
25 import java.util.concurrent.Callable; | 26 import java.util.concurrent.Callable; |
26 import java.util.concurrent.CountDownLatch; | 27 import java.util.concurrent.CountDownLatch; |
27 import java.util.concurrent.atomic.AtomicBoolean; | 28 import java.util.concurrent.atomic.AtomicBoolean; |
28 | 29 |
29 /** | 30 /** |
30 * Integration tests for synchronous scrolling. | 31 * Integration tests for synchronous scrolling. |
31 */ | 32 */ |
32 @MinAndroidSdkLevel(Build.VERSION_CODES.KITKAT) | 33 @MinAndroidSdkLevel(Build.VERSION_CODES.KITKAT) |
| 34 @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") |
33 public class AndroidScrollIntegrationTest extends AwTestBase { | 35 public class AndroidScrollIntegrationTest extends AwTestBase { |
34 private static class OverScrollByCallbackHelper extends CallbackHelper { | 36 private static class OverScrollByCallbackHelper extends CallbackHelper { |
35 int mDeltaX; | 37 int mDeltaX; |
36 int mDeltaY; | 38 int mDeltaY; |
37 int mScrollRangeY; | 39 int mScrollRangeY; |
38 | 40 |
39 public int getDeltaX() { | 41 public int getDeltaX() { |
40 assert getCallCount() > 0; | 42 assert getCallCount() > 0; |
41 return mDeltaX; | 43 return mDeltaX; |
42 } | 44 } |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 assertTrue(String.format(Locale.ENGLISH, | 763 assertTrue(String.format(Locale.ENGLISH, |
762 "Scroll range should increase after zoom (%d) > (%d)", | 764 "Scroll range should increase after zoom (%d) > (%d)", |
763 newScrollRange, oldScrollRange), newScrollRange > oldScr
ollRange); | 765 newScrollRange, oldScrollRange), newScrollRange > oldScr
ollRange); |
764 assertEquals(awContents.getContentHeightCss(), oldContentHeightA
pproximation); | 766 assertEquals(awContents.getContentHeightCss(), oldContentHeightA
pproximation); |
765 assertEquals(awContents.getContentHeightCss(), newContentHeightA
pproximation); | 767 assertEquals(awContents.getContentHeightCss(), newContentHeightA
pproximation); |
766 } | 768 } |
767 }); | 769 }); |
768 | 770 |
769 } | 771 } |
770 } | 772 } |
OLD | NEW |