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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java

Issue 2632043002: Create ContentShellActivityTestRule and BaseJUnitRunner (Closed)
Patch Set: Change javadoc Created 3 years, 9 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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.res.Configuration; 7 import android.content.res.Configuration;
8 import android.os.SystemClock; 8 import android.os.SystemClock;
9 import android.support.test.filters.SmallTest; 9 import android.support.test.filters.SmallTest;
10 import android.view.InputDevice; 10 import android.view.InputDevice;
11 import android.view.KeyEvent; 11 import android.view.KeyEvent;
12 import android.view.MotionEvent; 12 import android.view.MotionEvent;
13 13
14 import org.chromium.base.test.util.Feature; 14 import org.chromium.base.test.util.Feature;
15 import org.chromium.base.test.util.RetryOnFailure; 15 import org.chromium.base.test.util.RetryOnFailure;
16 import org.chromium.base.test.util.UrlUtils; 16 import org.chromium.base.test.util.UrlUtils;
17 import org.chromium.content.browser.ContentViewCore.InternalAccessDelegate; 17 import org.chromium.content.browser.ContentViewCore.InternalAccessDelegate;
18 import org.chromium.content.browser.test.util.Criteria; 18 import org.chromium.content.browser.test.util.Criteria;
19 import org.chromium.content.browser.test.util.CriteriaHelper; 19 import org.chromium.content.browser.test.util.CriteriaHelper;
20 import org.chromium.content_shell_apk.ContentShellActivityTestRule.RerunWithUpda tedContainerView;
20 import org.chromium.content_shell_apk.ContentShellTestBase; 21 import org.chromium.content_shell_apk.ContentShellTestBase;
21 22
22 /** 23 /**
23 * Tests that we can scroll and fling a ContentView running inside ContentShell. 24 * Tests that we can scroll and fling a ContentView running inside ContentShell.
24 */ 25 */
25 public class ContentViewScrollingTest extends ContentShellTestBase { 26 public class ContentViewScrollingTest extends ContentShellTestBase {
26 27
27 private static final String LARGE_PAGE = UrlUtils.encodeHtmlDataUri("<html>< head>" 28 private static final String LARGE_PAGE = UrlUtils.encodeHtmlDataUri("<html>< head>"
28 + "<meta name=\"viewport\" content=\"width=device-width, " 29 + "<meta name=\"viewport\" content=\"width=device-width, "
29 + "initial-scale=2.0, maximum-scale=2.0\" />" 30 + "initial-scale=2.0, maximum-scale=2.0\" />"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 scrollTo(scrollToX, scrollToY); 330 scrollTo(scrollToX, scrollToY);
330 assertWaitForScroll(false, false); 331 assertWaitForScroll(false, false);
331 CriteriaHelper.pollInstrumentationThread(new Criteria() { 332 CriteriaHelper.pollInstrumentationThread(new Criteria() {
332 @Override 333 @Override
333 public boolean isSatisfied() { 334 public boolean isSatisfied() {
334 return containerViewInternals.isScrollChanged(); 335 return containerViewInternals.isScrollChanged();
335 } 336 }
336 }); 337 });
337 } 338 }
338 } 339 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698