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

Unified Diff: base/android/jni_map_unittest.cc

Issue 12255042: [Android] Introduce a Java wrapper for TemplateUrlService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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
Index: base/android/jni_map_unittest.cc
diff --git a/base/android/jni_map_unittest.cc b/base/android/jni_map_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..188926dfa9dfca0a2253f9f02f04fed51590e3a9
--- /dev/null
+++ b/base/android/jni_map_unittest.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/android/jni_map.h"
+
+#include "base/android/jni_android.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/utf_string_conversions.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace base {
+namespace android {
+
+TEST(JniMap, BasicConversions) {
+ std::map<std::string, string16> test_map;
+ test_map["foo"] = UTF8ToUTF16("bar");
+ test_map["key"] = UTF8ToUTF16("value");
+ JNIEnv* env = AttachCurrentThread();
+ std::map<std::string, string16> result =
+ ConvertJavaMapToMap(env, ConvertMapToJavaMap(env, test_map).obj());
+ EXPECT_EQ(test_map, result);
+}
+
+} // namespace android
+} // namespace base
« base/android/jni_map.h ('K') | « base/android/jni_map.cc ('k') | base/base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698