Commit c08d7a28 authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Report all frame submissions in VR scrolling tests

VR Scrolling tests want to know about all page offset changes, whether
or not these impact browser UI. To allow for this in tests, we now call
WebContentsUtils.reportAllFrameSubmissions.

Change-Id: If3dd017b0709b1f0719e81129af7e2b94aa1d11a
Reviewed-on: https://chromium-review.googlesource.com/1194332Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Commit-Queue: Eric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587300}
parent 435e9aaa
......@@ -32,6 +32,7 @@ import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.ChromeTabUtils;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
import org.chromium.content.browser.test.util.WebContentsUtils;
import org.chromium.content_public.browser.RenderCoordinates;
import java.util.concurrent.Callable;
......@@ -56,6 +57,10 @@ public class VrBrowserControllerInputTest {
@Before
public void setUp() throws Exception {
// Ensure that all frame updates are delivered to the browser so we can monitor for
// scroll changes.
WebContentsUtils.reportAllFrameSubmissions(mVrTestRule.getWebContents(), true);
mVrBrowserTestFramework = new VrBrowserTestFramework(mVrTestRule);
VrBrowserTransitionUtils.forceEnterVrBrowserOrFail(POLL_TIMEOUT_LONG_MS);
mController = new EmulatedVrController(mVrTestRule.getActivity());
......
......@@ -23,6 +23,7 @@ import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.WebContentsUtils;
import org.chromium.content_public.browser.ViewEventSink.InternalAccessDelegate;
import org.chromium.content_shell_apk.ContentShellActivityTestRule;
import org.chromium.content_shell_apk.ContentShellActivityTestRule.RerunWithUpdatedContainerView;
......@@ -160,7 +161,7 @@ public class ContentViewScrollingTest {
mActivityTestRule.launchContentShellWithUrl(LARGE_PAGE);
mActivityTestRule.waitForActiveShellToBeDoneLoading();
mCoordinates = mActivityTestRule.getRenderCoordinates();
mActivityTestRule.reportAllFrameSubmissions(true);
WebContentsUtils.reportAllFrameSubmissions(mActivityTestRule.getWebContents(), true);
waitForViewportInitialization();
Assert.assertEquals(0, mCoordinates.getScrollXPixInt());
......
......@@ -4,6 +4,7 @@
package org.chromium.content.browser.test.util;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.content.browser.input.SelectPopup;
import org.chromium.content_public.browser.RenderFrameHost;
......@@ -21,7 +22,8 @@ public class WebContentsUtils {
* @param enabled Whether to report all frame submissions.
*/
public static void reportAllFrameSubmissions(final WebContents webContents, boolean enabled) {
nativeReportAllFrameSubmissions(webContents, enabled);
ThreadUtils.runOnUiThreadBlocking(
() -> { nativeReportAllFrameSubmissions(webContents, enabled); });
}
/**
......
......@@ -28,7 +28,6 @@ import org.chromium.content.browser.RenderCoordinatesImpl;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.WebContentsUtils;
import org.chromium.content.browser.webcontents.WebContentsImpl;
import org.chromium.content_public.browser.JavascriptInjector;
import org.chromium.content_public.browser.LoadUrlParams;
......@@ -185,15 +184,6 @@ public class ContentShellActivityTestRule extends ActivityTestRule<ContentShellA
}
}
/**
* Updates RenderCoordinates with all frame submissions, even those with no UI-visible change.
*/
public void reportAllFrameSubmissions(boolean enabled) {
final WebContents webContents = getWebContents();
ThreadUtils.runOnUiThreadBlocking(
() -> { WebContentsUtils.reportAllFrameSubmissions(webContents, enabled); });
}
public JavascriptInjector getJavascriptInjector() {
return JavascriptInjector.fromWebContents(getWebContents());
}
......
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