Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Unified Diff: mojo/android/javatests/validation_test_util.cc

Issue 601163002: mojo: Fix mojo test on Art runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CHECJ size is 0 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/android/javatests/validation_test_util.cc
diff --git a/mojo/android/javatests/validation_test_util.cc b/mojo/android/javatests/validation_test_util.cc
index 31aa3699b1f3cb7f79fe79e5fe63f4c8453b1616..2289e025a838b3bd70b954763d2a908bce0a1e1a 100644
--- a/mojo/android/javatests/validation_test_util.cc
+++ b/mojo/android/javatests/validation_test_util.cc
@@ -31,9 +31,13 @@ jobject ParseData(JNIEnv* env, jclass jcaller, jstring data_as_string) {
return Java_ValidationTestUtil_buildData(
env, NULL, 0, j_error_message.obj()).Release();
}
-
+ void* data_ptr = &data[0];
+ if (!data_ptr) {
+ DCHECK(!data.size());
+ data_ptr = &data;
+ }
jobject byte_buffer =
- env->NewDirectByteBuffer(&data[0], data.size());
+ env->NewDirectByteBuffer(data_ptr, data.size());
return Java_ValidationTestUtil_buildData(env, byte_buffer, num_handles, NULL)
.Release();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698