Skip to content

Commit

Permalink
crostini: change default container values for export and import calls
Browse files Browse the repository at this point in the history
Change the calls made to CrostiniManager so container_id from the
UI actually get passed through to cicerone.

container in a non-default VM.

Tests: unittests added for exporting and importing a non-default
Bug: b/223728452
Change-Id: Ic0f150a6b193cb0da3757ecc5d7e747b9ff7c99b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3567843
Reviewed-by: Timothy Loh <timloh@chromium.org>
Commit-Queue: Sophia Lin <sophialin@google.com>
Cr-Commit-Position: refs/heads/main@{#988774}
  • Loading branch information
SoapHia authored and Chromium LUCI CQ committed Apr 5, 2022
1 parent 01a4d60 commit fd55a55
Show file tree
Hide file tree
Showing 3 changed files with 272 additions and 62 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/ash/crostini/crostini_export_import.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ void CrostiniExportImport::ExportAfterSharing(
return;
}
CrostiniManager::GetForProfile(profile_)->ExportLxdContainer(
ContainerId::GetDefault(), container_path,
container_id, container_path,
base::BindOnce(&CrostiniExportImport::OnExportComplete,
weak_ptr_factory_.GetWeakPtr(), base::Time::Now(),
container_id, std::move(callback)));
Expand Down Expand Up @@ -508,7 +508,7 @@ void CrostiniExportImport::ImportAfterSharing(
return;
}
CrostiniManager::GetForProfile(profile_)->ImportLxdContainer(
ContainerId::GetDefault(), container_path,
container_id, container_path,
base::BindOnce(&CrostiniExportImport::OnImportComplete,
weak_ptr_factory_.GetWeakPtr(), base::Time::Now(),
container_id, std::move(callback)));
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/ash/crostini/crostini_export_import.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,15 @@ class CrostiniExportImport : public KeyedService,
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest,
TestDeprecatedExportSuccess);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest, TestExportSuccess);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest,
TestExportCustomVmContainerSuccess);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest, TestExportFail);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest, TestExportCancelled);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest,
TestExportDoneBeforeCancelled);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest, TestImportSuccess);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest,
TestImportCustomVmContainerSuccess);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest, TestImportFail);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest, TestImportCancelled);
FRIEND_TEST_ALL_PREFIXES(CrostiniExportImportTest,
Expand Down

0 comments on commit fd55a55

Please sign in to comment.