OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/android/jni_map.h" |
| 6 |
| 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/utf_string_conversions.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 |
| 12 namespace base { |
| 13 namespace android { |
| 14 |
| 15 TEST(JniMap, BasicConversions) { |
| 16 std::map<std::string, string16> test_map; |
| 17 test_map["foo"] = UTF8ToUTF16("bar"); |
| 18 test_map["key"] = UTF8ToUTF16("value"); |
| 19 JNIEnv* env = AttachCurrentThread(); |
| 20 std::map<std::string, string16> result = |
| 21 ConvertJavaMapToMap(env, ConvertMapToJavaMap(env, test_map).obj()); |
| 22 EXPECT_EQ(test_map, result); |
| 23 } |
| 24 |
| 25 } // namespace android |
| 26 } // namespace base |
OLD | NEW |