Commit e6852d5d authored by jonross's avatar jonross Committed by Commit Bot

Add Flag to Prevent Timed Locking of Android Controls

BrowserStateBrowserControlsVisibilityDelegate has a timer which is used to
ensure that the browser controls are visible for a minimum amount of time.

However this causes a race condition for telemetry tests. The controls can
become unlocked after telemetry has triggered a scroll. This leads to incidental
compositor frame submissions which affect the performance.

Pinpoint job with associated traces for the jank: https://pinpoint-dot-chromeperf.appspot.com/job/11a923eae40000

This change adds an Android specific flag to prevent locking the controls for
this timed duration. Page loading will still cause locks. Though tests tend to
wait for loading to complete already, so that lock will not affect the
measurements

TEST=Ran telemetry rendering.mobile scrolling stories

Bug: 896264
Change-Id: Ia1b3451cf4e4b7170b3478861a4e91316ab3bee5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1696189Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676950}
parent bee91e9e
...@@ -7,8 +7,10 @@ package org.chromium.chrome.browser.fullscreen; ...@@ -7,8 +7,10 @@ package org.chromium.chrome.browser.fullscreen;
import android.os.Handler; import android.os.Handler;
import android.os.SystemClock; import android.os.SystemClock;
import org.chromium.base.CommandLine;
import org.chromium.base.Supplier; import org.chromium.base.Supplier;
import org.chromium.base.VisibleForTesting; import org.chromium.base.VisibleForTesting;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.tab.BrowserControlsVisibilityDelegate; import org.chromium.chrome.browser.tab.BrowserControlsVisibilityDelegate;
/** /**
...@@ -48,6 +50,9 @@ public class BrowserStateBrowserControlsVisibilityDelegate ...@@ -48,6 +50,9 @@ public class BrowserStateBrowserControlsVisibilityDelegate
} }
private void ensureControlsVisibleForMinDuration() { private void ensureControlsVisibleForMinDuration() {
// Do not lock the controls as visible. Such as in testing.
if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_MINIMUM_SHOW_DURATION))
return;
if (mHandler.hasMessages(0)) return; // Messages sent via post/postDelayed have what=0 if (mHandler.hasMessages(0)) return; // Messages sent via post/postDelayed have what=0
long currentShowingTime = SystemClock.uptimeMillis() - mCurrentShowingStartTime; long currentShowingTime = SystemClock.uptimeMillis() - mCurrentShowingStartTime;
......
...@@ -15,6 +15,12 @@ public abstract class ChromeSwitches {{ ...@@ -15,6 +15,12 @@ public abstract class ChromeSwitches {{
/** Whether fullscreen support is disabled (auto hiding controls, etc...). */ /** Whether fullscreen support is disabled (auto hiding controls, etc...). */
public static final String DISABLE_FULLSCREEN = "disable-fullscreen"; public static final String DISABLE_FULLSCREEN = "disable-fullscreen";
/**
* When fullscreen support is enabled, this will disable the timer which
* ensures the browser controls are visible for a minium period of time.
*/
public static final String DISABLE_MINIMUM_SHOW_DURATION = "disable-minimum-show-duration";
/** Whether instant is disabled. */ /** Whether instant is disabled. */
public static final String DISABLE_INSTANT = "disable-instant"; public static final String DISABLE_INSTANT = "disable-instant";
......
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