OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.test.suitebuilder.annotation.SmallTest; | 7 import android.test.suitebuilder.annotation.SmallTest; |
8 | 8 |
9 import org.chromium.base.annotations.SuppressFBWarnings; | |
10 import org.chromium.base.test.util.Feature; | 9 import org.chromium.base.test.util.Feature; |
11 | 10 |
12 /** | 11 /** |
13 * Part of the test suite for the Java Bridge. This class tests that we correctl
y convert | 12 * Part of the test suite for the Java Bridge. This class tests that we correctl
y convert |
14 * JavaScript arrays to Java arrays when passing them to the methods of injected
Java objects. | 13 * JavaScript arrays to Java arrays when passing them to the methods of injected
Java objects. |
15 * | 14 * |
16 * The conversions should follow | 15 * The conversions should follow |
17 * http://jdk6.java.net/plugin2/liveconnect/#JS_JAVA_CONVERSIONS. Places in | 16 * http://jdk6.java.net/plugin2/liveconnect/#JS_JAVA_CONVERSIONS. Places in |
18 * which the implementation differs from the spec are marked with | 17 * which the implementation differs from the spec are marked with |
19 * LIVECONNECT_COMPLIANCE. | 18 * LIVECONNECT_COMPLIANCE. |
20 * FIXME: Consider making our implementation more compliant, if it will not | 19 * FIXME: Consider making our implementation more compliant, if it will not |
21 * break backwards-compatibility. See b/4408210. | 20 * break backwards-compatibility. See b/4408210. |
22 */ | 21 */ |
23 public class JavaBridgeArrayCoercionTest extends JavaBridgeTestBase { | 22 public class JavaBridgeArrayCoercionTest extends JavaBridgeTestBase { |
24 @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") | |
25 private class TestObject extends Controller { | 23 private class TestObject extends Controller { |
26 private final Object mObjectInstance; | 24 private final Object mObjectInstance; |
27 private final CustomType mCustomTypeInstance; | 25 private final CustomType mCustomTypeInstance; |
28 | 26 |
29 private boolean[] mBooleanArray; | 27 private boolean[] mBooleanArray; |
30 private byte[] mByteArray; | 28 private byte[] mByteArray; |
31 private char[] mCharArray; | 29 private char[] mCharArray; |
32 private short[] mShortArray; | 30 private short[] mShortArray; |
33 private int[] mIntArray; | 31 private int[] mIntArray; |
34 private long[] mLongArray; | 32 private long[] mLongArray; |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 executeJavaScript("testObject.setObjectArray(float64_array);"); | 956 executeJavaScript("testObject.setObjectArray(float64_array);"); |
959 assertNull(mTestObject.waitForObjectArray()); | 957 assertNull(mTestObject.waitForObjectArray()); |
960 | 958 |
961 executeJavaScript("testObject.setStringArray(float64_array);"); | 959 executeJavaScript("testObject.setStringArray(float64_array);"); |
962 assertNull(mTestObject.waitForStringArray()[0]); | 960 assertNull(mTestObject.waitForStringArray()[0]); |
963 | 961 |
964 executeJavaScript("testObject.setCustomTypeArray(float64_array);"); | 962 executeJavaScript("testObject.setCustomTypeArray(float64_array);"); |
965 assertNull(mTestObject.waitForCustomTypeArray()); | 963 assertNull(mTestObject.waitForCustomTypeArray()); |
966 } | 964 } |
967 } | 965 } |
OLD | NEW |