Commit a91f0289 authored by Brian Sheedy's avatar Brian Sheedy Committed by Commit Bot

Increase VR setting service delay

Increases the delay after sending an intent to the VR settings service
from 500 milliseconds to 3 seconds. Apparently it's possible for the
service to take multiple seconds to actually apply the requested
settings, in which case the test would run without the proper
settings actually being applied. Most commonly, this resulted in the
DON flow being skipped when we expected it to be present.

TBR=billorr@chromium.org

Bug: 972153
Change-Id: Iba9265c67cac5e5aee55a2dd85b2d2b0ab1170ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1650087Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667352}
parent e0f6bd38
...@@ -40,7 +40,8 @@ public class VrSettingsServiceUtils { ...@@ -40,7 +40,8 @@ public class VrSettingsServiceUtils {
private static final String EXTRA_ACTION_VALUE = "UPDATE_SETTINGS"; private static final String EXTRA_ACTION_VALUE = "UPDATE_SETTINGS";
private static final String EXTRA_VR_SETTINGS_PATH = "vr_settings_path"; private static final String EXTRA_VR_SETTINGS_PATH = "vr_settings_path";
private static final int SETTINGS_APPLICATION_DELAY_MS = 500; // Needs to be long because this can occasionally take multiple seconds to apply.
private static final int SETTINGS_APPLICATION_DELAY_MS = 3000;
/** /**
* Applies the settings specified in the provided file to VrCore. * Applies the settings specified in the provided file to VrCore.
...@@ -69,10 +70,10 @@ public class VrSettingsServiceUtils { ...@@ -69,10 +70,10 @@ public class VrSettingsServiceUtils {
// We need to tell the rule whether the newly applied settings enable the DON flow. // We need to tell the rule whether the newly applied settings enable the DON flow.
rule.setDonEnabled(fileEnablesDon(filename)); rule.setDonEnabled(fileEnablesDon(filename));
// The settings seem to apply nearly instantly, but since it's done through a service, we // The settings usually apply nearly instantly, but can occasionally take multiple seconds.
// don't have any guarantees about that or a way to be notified when they're applied. So, // Since this is done through a service, we don't have any guarantees about that or a way to
// sleep a bit to be safe. This shouldn't be an issue in terms of runtime since this is // be notified when they're applied. So, sleep for a while. This is a long sleep, but few
// used pretty infrequently. // tests use this functionality, so overall runtime impact is pretty low.
SystemClock.sleep(SETTINGS_APPLICATION_DELAY_MS); SystemClock.sleep(SETTINGS_APPLICATION_DELAY_MS);
} }
......
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