Commit a031efa9 authored by Ben Murdoch's avatar Ben Murdoch
Browse files

Merge from Chromium at DEPS revision r217092

This commit was generated by merge_to_master.py.

Change-Id: I91a8ab76ffb254434b2a39ea11e0b6a0e34b9159
parent 60845df7
...@@ -11,7 +11,7 @@ vars = { ...@@ -11,7 +11,7 @@ vars = {
'git_url': 'git_url':
'https://chromium.googlesource.com', 'https://chromium.googlesource.com',
'webkit_rev': 'webkit_rev':
'@2384839ebef90ff82cbfc837374243a8b7985dc0' '@2901640416871fcfce5c4650ea7c2b5c545ef324'
} }
deps = { deps = {
...@@ -98,11 +98,11 @@ deps = { ...@@ -98,11 +98,11 @@ deps = {
'src/third_party/sfntly/cpp/src': 'src/third_party/sfntly/cpp/src':
Var('git_url') + '/external/sfntly/cpp/src.git@cfb2f1743f0169ad8d01035458617bce97107539', Var('git_url') + '/external/sfntly/cpp/src.git@cfb2f1743f0169ad8d01035458617bce97107539',
'src/third_party/skia/gyp': 'src/third_party/skia/gyp':
Var('git_url') + '/external/skia/gyp.git@5afe400f473c747e2e5acb50b249fad1b8f2b0fc', Var('git_url') + '/external/skia/gyp.git@d147bb92759ec927a4cc53ab5817439991378fad',
'src/third_party/skia/include': 'src/third_party/skia/include':
Var('git_url') + '/external/skia/include.git@9b8ab717a6bf3fdc5eaa0ef5845c8daa14e3604b', Var('git_url') + '/external/skia/include.git@1b5ed10ab357a71ecd169a46a654574ad7d57363',
'src/third_party/skia/src': 'src/third_party/skia/src':
Var('git_url') + '/external/skia/src.git@06e8b2aa9249ff96559f7c08adffa83f4e855258', Var('git_url') + '/external/skia/src.git@1f1c0d428453bea56d6092a89906fb668a7900f9',
'src/third_party/smhasher/src': 'src/third_party/smhasher/src':
Var('git_url') + '/external/smhasher.git@6f63a4882e6b2cf87e8eec1a3ef8644e0d963283', Var('git_url') + '/external/smhasher.git@6f63a4882e6b2cf87e8eec1a3ef8644e0d963283',
'src/third_party/snappy/src': 'src/third_party/snappy/src':
...@@ -130,13 +130,13 @@ deps = { ...@@ -130,13 +130,13 @@ deps = {
'src/tools/grit': 'src/tools/grit':
Var('git_url') + '/external/grit-i18n.git@fbf8c54856bccf2d3e2431127ab334ab1dbd619e', Var('git_url') + '/external/grit-i18n.git@fbf8c54856bccf2d3e2431127ab334ab1dbd619e',
'src/tools/gyp': 'src/tools/gyp':
Var('git_url') + '/external/gyp.git@172357f39aae2e09793d6b2dddec3b2ce518ff8d', Var('git_url') + '/external/gyp.git@793f69bbc09792052636dbe6038678b24d68e11b',
'src/tools/page_cycler/acid3': 'src/tools/page_cycler/acid3':
Var('git_url') + '/chromium/deps/acid3.git@6be0a66a1ebd7ebc5abc1b2f405a945f6d871521', Var('git_url') + '/chromium/deps/acid3.git@6be0a66a1ebd7ebc5abc1b2f405a945f6d871521',
'src/tools/swarm_client': 'src/tools/swarm_client':
Var('git_url') + '/chromium/tools/swarm_client.git@86681e9a54c88972dba217b4f1007222dd8936a4', Var('git_url') + '/chromium/tools/swarm_client.git@51336a32732d4eea3f07e44e4a62c4d8103ef29f',
'src/v8': 'src/v8':
Var('git_url') + '/external/v8.git@89acc0bef1acf051e807b057dbcbcd478a8ad301', Var('git_url') + '/external/v8.git@387c3b089100ae5db9136ef045e71086f007d907',
} }
deps_os = { deps_os = {
......
...@@ -8,7 +8,7 @@ vars = { ...@@ -8,7 +8,7 @@ vars = {
"sourceforge_url": "http://svn.code.sf.net/p/%(repo)s/code", "sourceforge_url": "http://svn.code.sf.net/p/%(repo)s/code",
"webkit_trunk": "http://src.chromium.org/blink/trunk", "webkit_trunk": "http://src.chromium.org/blink/trunk",
"nacl_trunk": "http://src.chromium.org/native_client/trunk", "nacl_trunk": "http://src.chromium.org/native_client/trunk",
"webkit_revision": "155921", "webkit_revision": "155942",
"chromium_git": "https://chromium.googlesource.com", "chromium_git": "https://chromium.googlesource.com",
"chromiumos_git": "https://chromium.googlesource.com/chromiumos", "chromiumos_git": "https://chromium.googlesource.com/chromiumos",
"skia_git": "https://skia.googlesource.com", "skia_git": "https://skia.googlesource.com",
...@@ -29,12 +29,12 @@ vars = { ...@@ -29,12 +29,12 @@ vars = {
"ffmpeg_hash": "894e6f715645528e815aee2dad45b59704238dcd", "ffmpeg_hash": "894e6f715645528e815aee2dad45b59704238dcd",
"sfntly_revision": "134", "sfntly_revision": "134",
"skia_revision": "10648", "skia_revision": "10680",
"skia_hash": "a5b11fcd59d769450ac85a3b1e88d2e6eaca865e", "skia_hash": "8f4825bfb1da69439e1e96a0c6ea04488757d95e",
# Three lines of non-changing comments so that # Three lines of non-changing comments so that
# the commit queue can handle CLs rolling Skia # the commit queue can handle CLs rolling Skia
# and V8 without interference from each other. # and V8 without interference from each other.
"v8_revision": "16142", "v8_revision": "16159",
# Three lines of non-changing comments so that # Three lines of non-changing comments so that
# the commit queue can handle CLs rolling WebRTC # the commit queue can handle CLs rolling WebRTC
# and V8 without interference from each other. # and V8 without interference from each other.
...@@ -44,7 +44,7 @@ vars = { ...@@ -44,7 +44,7 @@ vars = {
# Three lines of non-changing comments so that # Three lines of non-changing comments so that
# the commit queue can handle CLs rolling swarm_client # the commit queue can handle CLs rolling swarm_client
# and whatever else without interference from each other. # and whatever else without interference from each other.
"swarm_revision": "213621", "swarm_revision": "217028",
# Three lines of non-changing comments so that # Three lines of non-changing comments so that
# the commit queue can handle CLs rolling openssl # the commit queue can handle CLs rolling openssl
# and whatever else without interference from each other. # and whatever else without interference from each other.
...@@ -103,7 +103,7 @@ deps = { ...@@ -103,7 +103,7 @@ deps = {
(Var("googlecode_url") % "grit-i18n") + "/trunk@129", (Var("googlecode_url") % "grit-i18n") + "/trunk@129",
"src/tools/gyp": "src/tools/gyp":
(Var("googlecode_url") % "gyp") + "/trunk@1682", (Var("googlecode_url") % "gyp") + "/trunk@1693",
"src/tools/swarm_client": "src/tools/swarm_client":
"/trunk/tools/swarm_client@" + Var("swarm_revision"), "/trunk/tools/swarm_client@" + Var("swarm_revision"),
......
...@@ -155,7 +155,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -155,7 +155,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -266,7 +265,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -266,7 +265,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -154,7 +154,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -154,7 +154,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -264,7 +263,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -264,7 +263,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -157,7 +157,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -157,7 +157,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -271,7 +270,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -271,7 +270,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -155,7 +155,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -155,7 +155,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -266,7 +265,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -266,7 +265,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -154,7 +154,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -154,7 +154,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -264,7 +263,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -264,7 +263,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -157,7 +157,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -157,7 +157,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -271,7 +270,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -271,7 +270,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -1283,21 +1283,21 @@ public class AwContents { ...@@ -1283,21 +1283,21 @@ public class AwContents {
* @see android.webkit.WebView#flingScroll(int, int) * @see android.webkit.WebView#flingScroll(int, int)
*/ */
public void flingScroll(int velocityX, int velocityY) { public void flingScroll(int velocityX, int velocityY) {
mContentViewCore.flingScroll(velocityX, velocityY); mScrollOffsetManager.flingScroll(velocityX, velocityY);
} }
/** /**
* @see android.webkit.WebView#pageUp(boolean) * @see android.webkit.WebView#pageUp(boolean)
*/ */
public boolean pageUp(boolean top) { public boolean pageUp(boolean top) {
return mContentViewCore.pageUp(top); return mScrollOffsetManager.pageUp(top);
} }
/** /**
* @see android.webkit.WebView#pageDown(boolean) * @see android.webkit.WebView#pageDown(boolean)
*/ */
public boolean pageDown(boolean bottom) { public boolean pageDown(boolean bottom) {
return mContentViewCore.pageDown(bottom); return mScrollOffsetManager.pageDown(bottom);
} }
/** /**
......
...@@ -18,6 +18,15 @@ import org.chromium.base.CalledByNative; ...@@ -18,6 +18,15 @@ import org.chromium.base.CalledByNative;
*/ */
@VisibleForTesting @VisibleForTesting
public class AwScrollOffsetManager { public class AwScrollOffsetManager {
// Values taken from WebViewClassic.
// The amount of content to overlap between two screens when using pageUp/pageDown methiods.
private static final int PAGE_SCROLL_OVERLAP = 24;
// Standard animated scroll speed.
private static final int STD_SCROLL_ANIMATION_SPEED_PIX_PER_SEC = 480;
// Time for the longest scroll animation.
private static final int MAX_SCROLL_ANIMATION_DURATION_MILLISEC = 750;
// The unit of all the values in this delegate are physical pixels. // The unit of all the values in this delegate are physical pixels.
public interface Delegate { public interface Delegate {
// Call View#overScrollBy on the containerView. // Call View#overScrollBy on the containerView.
...@@ -290,4 +299,68 @@ public class AwScrollOffsetManager { ...@@ -290,4 +299,68 @@ public class AwScrollOffsetManager {
mDelegate.invalidate(); mDelegate.invalidate();
} }
private static int computeDurationInMilliSec(int dx, int dy) {
int distance = Math.max(Math.abs(dx), Math.abs(dy));
int duration = distance * 1000 / STD_SCROLL_ANIMATION_SPEED_PIX_PER_SEC;
return Math.min(duration, MAX_SCROLL_ANIMATION_DURATION_MILLISEC);
}
private boolean animateScrollTo(int x, int y) {
final int scrollX = mDelegate.getContainerViewScrollX();
final int scrollY = mDelegate.getContainerViewScrollY();
x = clampHorizontalScroll(x);
y = clampVerticalScroll(y);
int dx = x - scrollX;
int dy = y - scrollY;
if (dx == 0 && dy == 0)
return false;
mScroller.startScroll(scrollX, scrollY, dx, dy, computeDurationInMilliSec(dx, dy));
mDelegate.invalidate();
return true;
}
/**
* See {@link WebView#pageUp(boolean)}
*/
public boolean pageUp(boolean top) {
final int scrollX = mDelegate.getContainerViewScrollX();
final int scrollY = mDelegate.getContainerViewScrollY();
if (top) {
// go to the top of the document
return animateScrollTo(scrollX, 0);
}
int dy = -mContainerViewHeight / 2;
if (mContainerViewHeight > 2 * PAGE_SCROLL_OVERLAP) {
dy = -mContainerViewHeight + PAGE_SCROLL_OVERLAP;
}
// animateScrollTo clamps the argument to the scrollable range so using (scrollY + dy) is
// fine.
return animateScrollTo(scrollX, scrollY + dy);
}
/**
* See {@link WebView#pageDown(boolean)}
*/
public boolean pageDown(boolean bottom) {
final int scrollX = mDelegate.getContainerViewScrollX();
final int scrollY = mDelegate.getContainerViewScrollY();
if (bottom) {
return animateScrollTo(scrollX, computeVerticalScrollRange());
}
int dy = mContainerViewHeight / 2;
if (mContainerViewHeight > 2 * PAGE_SCROLL_OVERLAP) {
dy = mContainerViewHeight - PAGE_SCROLL_OVERLAP;
}
// animateScrollTo clamps the argument to the scrollable range so using (scrollY + dy) is
// fine.
return animateScrollTo(scrollX, scrollY + dy);
}
} }
...@@ -23,6 +23,7 @@ import org.chromium.content.browser.test.util.Criteria; ...@@ -23,6 +23,7 @@ import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.ui.gfx.DeviceDisplayInfo; import org.chromium.ui.gfx.DeviceDisplayInfo;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
...@@ -544,4 +545,115 @@ public class AndroidScrollIntegrationTest extends AwTestBase { ...@@ -544,4 +545,115 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
} }
}); });
} }
@SmallTest
@Feature({"AndroidWebView"})
public void testFlingScroll() throws Throwable {
final TestAwContentsClient contentsClient = new TestAwContentsClient();
final ScrollTestContainerView testContainerView =
(ScrollTestContainerView) createAwTestContainerViewOnMainSync(contentsClient);
enableJavaScriptOnUiThread(testContainerView.getAwContents());
loadTestPageAndWaitForFirstFrame(testContainerView, contentsClient, null, "");
assertScrollOnMainSync(testContainerView, 0, 0);
final CallbackHelper onScrollToCallbackHelper =
testContainerView.getOnScrollToCallbackHelper();
final int scrollToCallCount = onScrollToCallbackHelper.getCallCount();
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
testContainerView.getAwContents().flingScroll(1000, 1000);
}
});
onScrollToCallbackHelper.waitForCallback(scrollToCallCount);
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
assertTrue(testContainerView.getScrollX() > 0);
assertTrue(testContainerView.getScrollY() > 0);
}
});
}
@SmallTest
@Feature({"AndroidWebView"})
public void testPageDown() throws Throwable {
final TestAwContentsClient contentsClient = new TestAwContentsClient();
final ScrollTestContainerView testContainerView =
(ScrollTestContainerView) createAwTestContainerViewOnMainSync(contentsClient);
enableJavaScriptOnUiThread(testContainerView.getAwContents());
loadTestPageAndWaitForFirstFrame(testContainerView, contentsClient, null, "");
assertScrollOnMainSync(testContainerView, 0, 0);
final int maxScrollYPix = runTestOnUiThreadAndGetResult(new Callable<Integer>() {
@Override
public Integer call() {
return (testContainerView.getAwContents().computeVerticalScrollRange() -
testContainerView.getHeight());
}
});
final CallbackHelper onScrollToCallbackHelper =
testContainerView.getOnScrollToCallbackHelper();
final int scrollToCallCount = onScrollToCallbackHelper.getCallCount();
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
testContainerView.getAwContents().pageDown(true);
}
});
// Wait for the animation to hit the bottom of the page.
for (int i = 1; ; ++i) {
onScrollToCallbackHelper.waitForCallback(scrollToCallCount, i);
if (checkScrollOnMainSync(testContainerView, 0, maxScrollYPix))
break;
}
}
@SmallTest
@Feature({"AndroidWebView"})
public void testPageUp() throws Throwable {
final TestAwContentsClient contentsClient = new TestAwContentsClient();
final ScrollTestContainerView testContainerView =
(ScrollTestContainerView) createAwTestContainerViewOnMainSync(contentsClient);
enableJavaScriptOnUiThread(testContainerView.getAwContents());
final double deviceDIPScale =
DeviceDisplayInfo.create(testContainerView.getContext()).getDIPScale();
final int targetScrollYCss = 243;
final int targetScrollYPix = (int) Math.round(targetScrollYCss * deviceDIPScale);
loadTestPageAndWaitForFirstFrame(testContainerView, contentsClient, null, "");
assertScrollOnMainSync(testContainerView, 0, 0);
scrollToOnMainSync(testContainerView, 0, targetScrollYPix);
final CallbackHelper onScrollToCallbackHelper =
testContainerView.getOnScrollToCallbackHelper();
final int scrollToCallCount = onScrollToCallbackHelper.getCallCount();
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
testContainerView.getAwContents().pageUp(true);
}
});
// Wait for the animation to hit the bottom of the page.
for (int i = 1; ; ++i) {
onScrollToCallbackHelper.waitForCallback(scrollToCallCount, i);
if (checkScrollOnMainSync(testContainerView, 0, 0))
break;
}
}
} }
...@@ -135,7 +135,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -135,7 +135,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -246,7 +245,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -246,7 +245,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -134,7 +134,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -134,7 +134,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -244,7 +243,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -244,7 +243,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -136,7 +136,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -136,7 +136,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -249,7 +248,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -249,7 +248,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -135,7 +135,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -135,7 +135,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -246,7 +245,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -246,7 +245,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -134,7 +134,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -134,7 +134,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -244,7 +243,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -244,7 +243,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -136,7 +136,6 @@ LOCAL_C_INCLUDES_Debug := \ ...@@ -136,7 +136,6 @@ LOCAL_C_INCLUDES_Debug := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
...@@ -249,7 +248,6 @@ LOCAL_C_INCLUDES_Release := \ ...@@ -249,7 +248,6 @@ LOCAL_C_INCLUDES_Release := \
$(LOCAL_PATH)/third_party/skia/include/effects \ $(LOCAL_PATH)/third_party/skia/include/effects \
$(LOCAL_PATH)/third_party/skia/include/pdf \ $(LOCAL_PATH)/third_party/skia/include/pdf \
$(LOCAL_PATH)/third_party/skia/include/gpu \ $(LOCAL_PATH)/third_party/skia/include/gpu \
$(LOCAL_PATH)/third_party/skia/include/gpu/gl \
$(LOCAL_PATH)/third_party/skia/include/lazy \ $(LOCAL_PATH)/third_party/skia/include/lazy \
$(LOCAL_PATH)/third_party/skia/include/pathops \ $(LOCAL_PATH)/third_party/skia/include/pathops \
$(LOCAL_PATH)/third_party/skia/include/pipe \ $(LOCAL_PATH)/third_party/skia/include/pipe \
......
...@@ -264,6 +264,15 @@ class NetworkWifiDetailedView : public NetworkDetailedView { ...@@ -264,6 +264,15 @@ class NetworkWifiDetailedView : public NetworkDetailedView {
} }
private: private:
virtual void Layout() OVERRIDE {
// Center both views vertically.
views::View::Layout();
image_view_->SetY(
(height() - image_view_->GetPreferredSize().height()) / 2);
label_view_->SetY(
(height() - label_view_->GetPreferredSize().height()) / 2);
}
void Update() { void Update() {
bool wifi_enabled = NetworkHandler::Get()->network_state_handler()-> bool wifi_enabled = NetworkHandler::Get()->network_state_handler()->
IsTechnologyEnabled(flimflam::kTypeWifi); IsTechnologyEnabled(flimflam::kTypeWifi);
...@@ -276,6 +285,9 @@ class NetworkWifiDetailedView : public NetworkDetailedView { ...@@ -276,6 +285,9 @@ class NetworkWifiDetailedView : public NetworkDetailedView {
IDS_ASH_STATUS_TRAY_NETWORK_WIFI_ENABLED : IDS_ASH_STATUS_TRAY_NETWORK_WIFI_ENABLED :
IDS_ASH_STATUS_TRAY_NETWORK_WIFI_DISABLED; IDS_ASH_STATUS_TRAY_NETWORK_WIFI_DISABLED;
label_view_->SetText(bundle.GetLocalizedString(string_id)); label_view_->SetText(bundle.GetLocalizedString(string_id));
label_view_->SizeToFit(kTrayPopupMinWidth -
kTrayPopupPaddingHorizontal * 2 - kTrayPopupPaddingBetweenItems -
kTrayPopupDetailsIconWidth);
} }
views::ImageView* image_view_; views::ImageView* image_view_;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "content/public/test/test_browser_context.h" #include "content/public/test/test_browser_context.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/compositor/compositor.h"
namespace ash { namespace ash {
namespace test { namespace test {
...@@ -203,6 +204,10 @@ double TestShellDelegate::GetSavedScreenMagnifierScale() { ...@@ -203,6 +204,10 @@ double TestShellDelegate::GetSavedScreenMagnifierScale() {
} }
RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() { RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() {
// The ContextFactory must exist before any Compositors are created.
bool allow_test_contexts = true;
ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts);
return RootWindowHostFactory::Create(); return RootWindowHostFactory::Create();
} }
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
#include "ui/compositor/compositor_setup.h"
#include "ui/gfx/gfx_paths.h" #include "ui/gfx/gfx_paths.h"
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
...@@ -55,7 +54,6 @@ void AuraShellTestSuite::Initialize() { ...@@ -55,7 +54,6 @@ void AuraShellTestSuite::Initialize() {
// Force unittests to run using en-US so if we test against string // Force unittests to run using en-US so if we test against string
// output, it'll pass regardless of the system language. // output, it'll pass regardless of the system language.
ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
ui::SetupTestCompositor();
} }
void AuraShellTestSuite::Shutdown() { void AuraShellTestSuite::Shutdown() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment