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.support.test.filters.SmallTest; | 7 import android.support.test.filters.SmallTest; |
8 | 8 |
9 import org.junit.Assert; | 9 import org.junit.Assert; |
10 import org.junit.Before; | 10 import org.junit.Before; |
(...skipping 12 matching lines...) Expand all Loading... |
23 * The conversions should follow | 23 * The conversions should follow |
24 * http://jdk6.java.net/plugin2/liveconnect/#JS_JAVA_CONVERSIONS. Places in | 24 * http://jdk6.java.net/plugin2/liveconnect/#JS_JAVA_CONVERSIONS. Places in |
25 * which the implementation differs from the spec are marked with | 25 * which the implementation differs from the spec are marked with |
26 * LIVECONNECT_COMPLIANCE. | 26 * LIVECONNECT_COMPLIANCE. |
27 * FIXME: Consider making our implementation more compliant, if it will not | 27 * FIXME: Consider making our implementation more compliant, if it will not |
28 * break backwards-compatibility. See b/4408210. | 28 * break backwards-compatibility. See b/4408210. |
29 */ | 29 */ |
30 @RunWith(BaseJUnit4ClassRunner.class) | 30 @RunWith(BaseJUnit4ClassRunner.class) |
31 public class JavaBridgeArrayTest { | 31 public class JavaBridgeArrayTest { |
32 @Rule | 32 @Rule |
33 public JavaBridgeActivityTestRule mActivityTestRule = new JavaBridgeActivity
TestRule(); | 33 public JavaBridgeActivityTestRule mActivityTestRule = |
| 34 new JavaBridgeActivityTestRule().shouldSetUp(true); |
34 | 35 |
35 @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") | 36 @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") |
36 private static class TestObject extends Controller { | 37 private static class TestObject extends Controller { |
37 private boolean mBooleanValue; | 38 private boolean mBooleanValue; |
38 private int mIntValue; | 39 private int mIntValue; |
39 private String mStringValue; | 40 private String mStringValue; |
40 | 41 |
41 private int[] mIntArray; | 42 private int[] mIntArray; |
42 private int[][] mIntIntArray; | 43 private int[][] mIntIntArray; |
43 | 44 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // for typed arrays (that also subclass ArrayBufferView) tests. | 288 // for typed arrays (that also subclass ArrayBufferView) tests. |
288 @Test | 289 @Test |
289 @SmallTest | 290 @SmallTest |
290 @Feature({"AndroidWebView", "Android-JavaBridge"}) | 291 @Feature({"AndroidWebView", "Android-JavaBridge"}) |
291 public void testPassDataView() throws Throwable { | 292 public void testPassDataView() throws Throwable { |
292 mActivityTestRule.executeJavaScript("buffer = new ArrayBuffer(16);"); | 293 mActivityTestRule.executeJavaScript("buffer = new ArrayBuffer(16);"); |
293 mActivityTestRule.executeJavaScript("testObject.setIntArray(new DataView
(buffer));"); | 294 mActivityTestRule.executeJavaScript("testObject.setIntArray(new DataView
(buffer));"); |
294 Assert.assertNull(mTestObject.waitForIntArray()); | 295 Assert.assertNull(mTestObject.waitForIntArray()); |
295 } | 296 } |
296 } | 297 } |
OLD | NEW |