Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java

Issue 287323002: Fix lint issues with AndroidScrollIntegrationTest.java. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import android.widget.OverScroller; 10 import android.widget.OverScroller;
11 11
12 import org.chromium.android_webview.AwContents; 12 import org.chromium.android_webview.AwContents;
13 import org.chromium.android_webview.AwScrollOffsetManager; 13 import org.chromium.android_webview.AwScrollOffsetManager;
14 import org.chromium.android_webview.test.util.AwTestTouchUtils; 14 import org.chromium.android_webview.test.util.AwTestTouchUtils;
15 import org.chromium.android_webview.test.util.CommonResources; 15 import org.chromium.android_webview.test.util.CommonResources;
16 import org.chromium.android_webview.test.util.JavascriptEventObserver; 16 import org.chromium.android_webview.test.util.JavascriptEventObserver;
17 import org.chromium.base.test.util.Feature; 17 import org.chromium.base.test.util.Feature;
18 import org.chromium.content.browser.test.util.CallbackHelper; 18 import org.chromium.content.browser.test.util.CallbackHelper;
19 import org.chromium.content_public.browser.GestureStateListener; 19 import org.chromium.content_public.browser.GestureStateListener;
20 import org.chromium.ui.gfx.DeviceDisplayInfo; 20 import org.chromium.ui.gfx.DeviceDisplayInfo;
21 21
22 import java.util.Locale;
22 import java.util.concurrent.Callable; 23 import java.util.concurrent.Callable;
23 import java.util.concurrent.CountDownLatch; 24 import java.util.concurrent.CountDownLatch;
24 import java.util.concurrent.atomic.AtomicBoolean; 25 import java.util.concurrent.atomic.AtomicBoolean;
25 26
26 /** 27 /**
27 * Integration tests for synchronous scrolling. 28 * Integration tests for synchronous scrolling.
28 */ 29 */
29 public class AndroidScrollIntegrationTest extends AwTestBase { 30 public class AndroidScrollIntegrationTest extends AwTestBase {
30 private static class OverScrollByCallbackHelper extends CallbackHelper { 31 private static class OverScrollByCallbackHelper extends CallbackHelper {
31 int mDeltaX; 32 int mDeltaX;
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 (int) Math.ceil(awContents.computeVerticalScrollRange() / ol dScale); 824 (int) Math.ceil(awContents.computeVerticalScrollRange() / ol dScale);
824 825
825 awContents.zoomIn(); 826 awContents.zoomIn();
826 827
827 int newScrollRange = 828 int newScrollRange =
828 awContents.computeVerticalScrollRange() - testContainerView. getHeight(); 829 awContents.computeVerticalScrollRange() - testContainerView. getHeight();
829 float newScale = awContents.getScale(); 830 float newScale = awContents.getScale();
830 int newContentHeightApproximation = 831 int newContentHeightApproximation =
831 (int) Math.ceil(awContents.computeVerticalScrollRange() / ne wScale); 832 (int) Math.ceil(awContents.computeVerticalScrollRange() / ne wScale);
832 833
833 assertTrue(String.format("Scale range should increase after zoom (%f) > (%f)", 834 assertTrue(String.format(Locale.ENGLISH,
835 "Scale range should increase after zoom (%f) > (%f)",
834 newScale, oldScale), newScale > oldScale); 836 newScale, oldScale), newScale > oldScale);
835 assertTrue(String.format("Scroll range should increase after zoo m (%d) > (%d)", 837 assertTrue(String.format(Locale.ENGLISH,
838 "Scroll range should increase after zoom (%d) > (%d)",
836 newScrollRange, oldScrollRange), newScrollRange > oldScr ollRange); 839 newScrollRange, oldScrollRange), newScrollRange > oldScr ollRange);
837 assertEquals(awContents.getContentHeightCss(), oldContentHeightA pproximation); 840 assertEquals(awContents.getContentHeightCss(), oldContentHeightA pproximation);
838 assertEquals(awContents.getContentHeightCss(), newContentHeightA pproximation); 841 assertEquals(awContents.getContentHeightCss(), newContentHeightA pproximation);
839 } 842 }
840 }); 843 });
841 844
842 } 845 }
843 } 846 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698