| 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.test.suitebuilder.annotation.SmallTest; | 8 import android.test.suitebuilder.annotation.SmallTest; | 
| 9 import android.view.View; | 9 import android.view.View; | 
| 10 | 10 | 
| 11 import org.chromium.android_webview.AwContents; | 11 import org.chromium.android_webview.AwContents; | 
| 12 import org.chromium.android_webview.AwScrollOffsetManager; | 12 import org.chromium.android_webview.AwScrollOffsetManager; | 
| 13 import org.chromium.android_webview.test.util.AwTestTouchUtils; | 13 import org.chromium.android_webview.test.util.AwTestTouchUtils; | 
| 14 import org.chromium.android_webview.test.util.CommonResources; | 14 import org.chromium.android_webview.test.util.CommonResources; | 
| 15 import org.chromium.android_webview.test.util.JavascriptEventObserver; | 15 import org.chromium.android_webview.test.util.JavascriptEventObserver; | 
| 16 import org.chromium.base.ThreadUtils; | 16 import org.chromium.base.ThreadUtils; | 
| 17 import org.chromium.base.annotations.SuppressFBWarnings; | 17 import org.chromium.base.annotations.SuppressFBWarnings; | 
| 18 import org.chromium.base.test.util.Feature; | 18 import org.chromium.base.test.util.Feature; | 
|  | 19 import org.chromium.base.test.util.parameter.ParameterizedTest; | 
| 19 import org.chromium.content.browser.test.util.CallbackHelper; | 20 import org.chromium.content.browser.test.util.CallbackHelper; | 
| 20 import org.chromium.content_public.browser.GestureStateListener; | 21 import org.chromium.content_public.browser.GestureStateListener; | 
| 21 import org.chromium.net.test.util.TestWebServer; | 22 import org.chromium.net.test.util.TestWebServer; | 
| 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 import java.util.concurrent.atomic.AtomicInteger; | 29 import java.util.concurrent.atomic.AtomicInteger; | 
| 29 import java.util.concurrent.atomic.AtomicReference; | 30 import java.util.concurrent.atomic.AtomicReference; | 
| 30 | 31 | 
| 31 /** | 32 /** | 
| 32  * Integration tests for synchronous scrolling. | 33  * Integration tests for synchronous scrolling. | 
| 33  */ | 34  */ | 
| 34 @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") | 35 @SuppressFBWarnings("DLS_DEAD_LOCAL_STORE") | 
|  | 36 // Run in single-process mode only. Blocked by rendering support crbug.com/52684
     2. | 
|  | 37 @ParameterizedTest.Set | 
| 35 public class AndroidScrollIntegrationTest extends AwTestBase { | 38 public class AndroidScrollIntegrationTest extends AwTestBase { | 
| 36     private TestWebServer mWebServer; | 39     private TestWebServer mWebServer; | 
| 37 | 40 | 
| 38     private static class OverScrollByCallbackHelper extends CallbackHelper { | 41     private static class OverScrollByCallbackHelper extends CallbackHelper { | 
| 39         int mDeltaX; | 42         int mDeltaX; | 
| 40         int mDeltaY; | 43         int mDeltaY; | 
| 41         int mScrollRangeY; | 44         int mScrollRangeY; | 
| 42 | 45 | 
| 43         public int getDeltaX() { | 46         public int getDeltaX() { | 
| 44             assert getCallCount() > 0; | 47             assert getCallCount() > 0; | 
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 861                 atomicNewScale.get(), atomicOldScale.get()), | 864                 atomicNewScale.get(), atomicOldScale.get()), | 
| 862                 atomicNewScale.get() > atomicOldScale.get()); | 865                 atomicNewScale.get() > atomicOldScale.get()); | 
| 863         assertTrue(String.format(Locale.ENGLISH, | 866         assertTrue(String.format(Locale.ENGLISH, | 
| 864                 "Scroll range should increase after zoom (%d) > (%d)", | 867                 "Scroll range should increase after zoom (%d) > (%d)", | 
| 865                 atomicNewScrollRange.get(), atomicOldScrollRange.get()), | 868                 atomicNewScrollRange.get(), atomicOldScrollRange.get()), | 
| 866                 atomicNewScrollRange.get() > atomicOldScrollRange.get()); | 869                 atomicNewScrollRange.get() > atomicOldScrollRange.get()); | 
| 867         assertEquals(atomicContentHeight.get(), atomicOldContentHeightApproximat
     ion.get()); | 870         assertEquals(atomicContentHeight.get(), atomicOldContentHeightApproximat
     ion.get()); | 
| 868         assertEquals(atomicContentHeight.get(), atomicNewContentHeightApproximat
     ion.get()); | 871         assertEquals(atomicContentHeight.get(), atomicNewContentHeightApproximat
     ion.get()); | 
| 869     } | 872     } | 
| 870 } | 873 } | 
| OLD | NEW | 
|---|