Commit 28792284 authored by Jeffrey Kardatzke's avatar Jeffrey Kardatzke Committed by Commit Bot

Set skip Crostini restart when enabling Crostini for testing

This modifies the private autotest API so that when it sets Crostini to
be enabled that it also notifies the CrostiniRestarter that it should
skip its restart phases. This will enable testing of features that
integrate into the Chrome launcher without having to invoke the slower
Crostini startup process that Chrome uses.

BUG=chromium:849438
TEST=Verified on eve that launcher apps can start after this

Change-Id: Ieaf9f8d41b8e077fc0ae44bae5ec12da9dcfcf92
Reviewed-on: https://chromium-review.googlesource.com/1227185Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
Cr-Commit-Position: refs/heads/master@{#591924}
parent 8c622763
...@@ -731,6 +731,12 @@ AutotestPrivateSetCrostiniEnabledFunction::Run() { ...@@ -731,6 +731,12 @@ AutotestPrivateSetCrostiniEnabledFunction::Run() {
// Set the preference to indicate Crostini is enabled/disabled. // Set the preference to indicate Crostini is enabled/disabled.
ProfileManager::GetActiveUserProfile()->GetPrefs()->SetBoolean( ProfileManager::GetActiveUserProfile()->GetPrefs()->SetBoolean(
crostini::prefs::kCrostiniEnabled, params->enabled); crostini::prefs::kCrostiniEnabled, params->enabled);
// Set the flag to indicate we are in testing mode so that Chrome doesn't
// try to start the VM/container itself.
crostini::CrostiniManager* crostini_manager =
crostini::CrostiniManager::GetForProfile(
ProfileManager::GetActiveUserProfile());
crostini_manager->set_skip_restart_for_testing();
return RespondNow(NoArguments()); return RespondNow(NoArguments());
#else #else
return RespondNow(Error(kOnlyAvailableOnChromeOSError)); return RespondNow(Error(kOnlyAvailableOnChromeOSError));
......
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