diff options
author | 2024-03-15 13:19:15 +0000 | |
---|---|---|
committer | 2024-03-15 19:11:32 +0000 | |
commit | 2f7cff3190f6ff931d62c027e420420281e20fa2 (patch) | |
tree | 2d112f892206a3edbc39bc0cedacd406086b151d /odrefresh/odrefresh_test.cc | |
parent | fe5718287dc947c4d29134afaa6aba4134d8497c (diff) |
Update odrefresh for Pre-reboot Dexopt.
- Add a mode to only generate boot image. The boot image will be used
for dexopting apps during Pre-reboot Dexopt.
- Make odrefresh headers accessible by other components in the ART
module. The headers contain odrefresh exit codes that artd needs to
check against.
Bug: 311377497
Test: atest art_standalone_odrefresh_tests
Change-Id: I56ba79646944b29b0c016a55a5f57a5a7c71d1a6
Diffstat (limited to 'odrefresh/odrefresh_test.cc')
-rw-r--r-- | odrefresh/odrefresh_test.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/odrefresh/odrefresh_test.cc b/odrefresh/odrefresh_test.cc index 91e1f66803..424b606ff8 100644 --- a/odrefresh/odrefresh_test.cc +++ b/odrefresh/odrefresh_test.cc @@ -994,5 +994,22 @@ TEST_F(OdRefreshTest, CompileSystemServerChoosesBootImage_OnSystem) { ExitCode::kCompilationSuccess); } +TEST_F(OdRefreshTest, OnlyBootImages) { + config_.SetOnlyBootImages(true); + + // Primary. + EXPECT_CALL(*mock_exec_utils_, DoExecAndReturnCode(Contains(Flag("--dex-file=", core_oj_jar_)))) + .Times(2) + .WillRepeatedly(Return(0)); + + // Mainline extension. + EXPECT_CALL(*mock_exec_utils_, DoExecAndReturnCode(Contains(Flag("--dex-file=", conscrypt_jar_)))) + .Times(2) + .WillRepeatedly(Return(0)); + + EXPECT_EQ(odrefresh_->Compile(*metrics_, CompilationOptions::CompileAll(*odrefresh_)), + ExitCode::kCompilationSuccess); +} + } // namespace odrefresh } // namespace art |