diff options
Diffstat (limited to 'odrefresh/odrefresh_test.cc')
-rw-r--r-- | odrefresh/odrefresh_test.cc | 57 |
1 files changed, 3 insertions, 54 deletions
diff --git a/odrefresh/odrefresh_test.cc b/odrefresh/odrefresh_test.cc index f44c3211c3..424b606ff8 100644 --- a/odrefresh/odrefresh_test.cc +++ b/odrefresh/odrefresh_test.cc @@ -177,9 +177,9 @@ class OdRefreshTest : public CommonArtTest { CreateEmptyFile(dirty_image_objects_file_); preloaded_classes_file_ = system_etc_dir + "/preloaded-classes"; CreateEmptyFile(preloaded_classes_file_); - art_etc_dir_ = android_art_root_path + "/etc"; - ASSERT_TRUE(EnsureDirectoryExists(art_etc_dir_)); - art_profile_ = art_etc_dir_ + "/boot-image.prof"; + std::string art_etc_dir = android_art_root_path + "/etc"; + ASSERT_TRUE(EnsureDirectoryExists(art_etc_dir)); + art_profile_ = art_etc_dir + "/boot-image.prof"; CreateEmptyFile(art_profile_); framework_dir_ = android_root_path + "/framework"; @@ -267,7 +267,6 @@ class OdRefreshTest : public CommonArtTest { std::string services_foo_jar_; std::string services_bar_jar_; std::string dalvik_cache_dir_; - std::string art_etc_dir_; std::string framework_dir_; std::string framework_profile_; std::string art_profile_; @@ -1012,55 +1011,5 @@ TEST_F(OdRefreshTest, OnlyBootImages) { ExitCode::kCompilationSuccess); } -TEST_F(OdRefreshTest, DirtyImageObjects) { - // Primary. - EXPECT_CALL(*mock_exec_utils_, - DoExecAndReturnCode(AllOf( - Contains(Flag("--dirty-image-objects-fd=", FdOf(dirty_image_objects_file_))), - Contains(Flag("--dex-file=", core_oj_jar_))))) - .WillOnce(Return(0)); - - // Mainline extension. - EXPECT_CALL(*mock_exec_utils_, - DoExecAndReturnCode(AllOf(Contains(Flag("--dex-file=", conscrypt_jar_))))) - .WillOnce(Return(0)); - - EXPECT_EQ(odrefresh_->Compile( - *metrics_, - CompilationOptions{ - .boot_images_to_generate_for_isas{ - {InstructionSet::kX86_64, - {.primary_boot_image = true, .boot_image_mainline_extension = true}}}, - }), - ExitCode::kCompilationSuccess); -} - -TEST_F(OdRefreshTest, DirtyImageObjectsMultipleFiles) { - std::string art_dirty_image_objects = art_etc_dir_ + "/dirty-image-objects"; - auto file = ScopedCreateEmptyFile(art_dirty_image_objects); - - // Primary. - EXPECT_CALL(*mock_exec_utils_, - DoExecAndReturnCode(AllOf( - Contains(Flag("--dirty-image-objects-fd=", FdOf(dirty_image_objects_file_))), - Contains(Flag("--dirty-image-objects-fd=", FdOf(art_dirty_image_objects))), - Contains(Flag("--dex-file=", core_oj_jar_))))) - .WillOnce(Return(0)); - - // Mainline extension. - EXPECT_CALL(*mock_exec_utils_, - DoExecAndReturnCode(AllOf(Contains(Flag("--dex-file=", conscrypt_jar_))))) - .WillOnce(Return(0)); - - EXPECT_EQ(odrefresh_->Compile( - *metrics_, - CompilationOptions{ - .boot_images_to_generate_for_isas{ - {InstructionSet::kX86_64, - {.primary_boot_image = true, .boot_image_mainline_extension = true}}}, - }), - ExitCode::kCompilationSuccess); -} - } // namespace odrefresh } // namespace art |