summaryrefslogtreecommitdiff
path: root/runtime/common_runtime_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2019-07-26 13:03:13 +0100
committer Vladimir Marko <vmarko@google.com> 2019-07-29 12:33:14 +0000
commit672c08092a7d95bb504bceb712812f72524d90da (patch)
treee539c269d8733b13e43c41f9784d0c6c8200a9d6 /runtime/common_runtime_test.cc
parente91d787c2de859789ec6e467bd04ee28b22a8c4e (diff)
Update Transaction for boot image extension.
And clean up transaction-related code to keep test code out of the production binaries. Test: Add TransactionTest#Constraints to transaction_test. Test: m test-art-host-gtest Test: testrunner.py --host Test: aosp_taimen-userdebug boots. Change-Id: Iefe5f1cfde95f564069249148f9e7d71564d7a10
Diffstat (limited to 'runtime/common_runtime_test.cc')
-rw-r--r--runtime/common_runtime_test.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index 05ec9e6d54..135dc7be73 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -433,6 +433,43 @@ bool CommonRuntimeTestImpl::StartDex2OatCommandLine(/*out*/std::vector<std::stri
return true;
}
+std::string CommonRuntimeTestImpl::GetImageDirectory() {
+ if (IsHost()) {
+ const char* host_dir = getenv("ANDROID_HOST_OUT");
+ CHECK(host_dir != nullptr);
+ return std::string(host_dir) + "/framework";
+ } else {
+ return std::string("/data/art-test");
+ }
+}
+
+std::string CommonRuntimeTestImpl::GetImageLocation() {
+ return GetImageDirectory() + "/core.art";
+}
+
+std::string CommonRuntimeTestImpl::GetSystemImageFile() {
+ return GetImageDirectory() + "/" + GetInstructionSetString(kRuntimeISA) + "/core.art";
+}
+
+void CommonRuntimeTestImpl::EnterTransactionMode() {
+ CHECK(!Runtime::Current()->IsActiveTransaction());
+ Runtime::Current()->EnterTransactionMode(/*strict=*/ false, /*root=*/ nullptr);
+}
+
+void CommonRuntimeTestImpl::ExitTransactionMode() {
+ Runtime::Current()->ExitTransactionMode();
+ CHECK(!Runtime::Current()->IsActiveTransaction());
+}
+
+void CommonRuntimeTestImpl::RollbackAndExitTransactionMode() {
+ Runtime::Current()->RollbackAndExitTransactionMode();
+ CHECK(!Runtime::Current()->IsActiveTransaction());
+}
+
+bool CommonRuntimeTestImpl::IsTransactionAborted() {
+ return Runtime::Current()->IsTransactionAborted();
+}
+
CheckJniAbortCatcher::CheckJniAbortCatcher() : vm_(Runtime::Current()->GetJavaVM()) {
vm_->SetCheckJniAbortHook(Hook, &actual_);
}