| 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 dalvik.system.DexClassLoader; | 9 import dalvik.system.DexClassLoader; |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 * which the implementation differs from the spec are marked with | 32 * which the implementation differs from the spec are marked with |
| 33 * LIVECONNECT_COMPLIANCE. | 33 * LIVECONNECT_COMPLIANCE. |
| 34 * FIXME: Consider making our implementation more compliant, if it will not | 34 * FIXME: Consider making our implementation more compliant, if it will not |
| 35 * break backwards-compatibility. See b/4408210. | 35 * break backwards-compatibility. See b/4408210. |
| 36 */ | 36 */ |
| 37 @RunWith(BaseJUnit4ClassRunner.class) | 37 @RunWith(BaseJUnit4ClassRunner.class) |
| 38 public class JavaBridgeCoercionTest { | 38 public class JavaBridgeCoercionTest { |
| 39 private static final double ASSERTION_DELTA = 0; | 39 private static final double ASSERTION_DELTA = 0; |
| 40 | 40 |
| 41 @Rule | 41 @Rule |
| 42 public JavaBridgeActivityTestRule mActivityTestRule = new JavaBridgeActivity
TestRule(); | 42 public JavaBridgeActivityTestRule mActivityTestRule = |
| 43 new JavaBridgeActivityTestRule().shouldSetUp(true); |
| 43 | 44 |
| 44 @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") | 45 @SuppressFBWarnings("CHROMIUM_SYNCHRONIZED_METHOD") |
| 45 private static class TestObject extends Controller { | 46 private static class TestObject extends Controller { |
| 46 private Object mObjectInstance; | 47 private Object mObjectInstance; |
| 47 private CustomType mCustomTypeInstance; | 48 private CustomType mCustomTypeInstance; |
| 48 private CustomType2 mCustomType2Instance; | 49 private CustomType2 mCustomType2Instance; |
| 49 | 50 |
| 50 private boolean mBooleanValue; | 51 private boolean mBooleanValue; |
| 51 private byte mByteValue; | 52 private byte mByteValue; |
| 52 private char mCharValue; | 53 private char mCharValue; |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 public void testPassFunctionObject() throws Throwable { | 864 public void testPassFunctionObject() throws Throwable { |
| 864 mActivityTestRule.executeJavaScript("func = new Function('a', 'b', 'retu
rn a + b');"); | 865 mActivityTestRule.executeJavaScript("func = new Function('a', 'b', 'retu
rn a + b');"); |
| 865 | 866 |
| 866 mActivityTestRule.executeJavaScript("testObject.setStringValue(func);"); | 867 mActivityTestRule.executeJavaScript("testObject.setStringValue(func);"); |
| 867 Assert.assertEquals("undefined", mTestObject.waitForStringValue()); | 868 Assert.assertEquals("undefined", mTestObject.waitForStringValue()); |
| 868 | 869 |
| 869 mActivityTestRule.executeJavaScript("testObject.setObjectValue(func);"); | 870 mActivityTestRule.executeJavaScript("testObject.setObjectValue(func);"); |
| 870 Assert.assertNull(mTestObject.waitForObjectValue()); | 871 Assert.assertNull(mTestObject.waitForObjectValue()); |
| 871 } | 872 } |
| 872 } | 873 } |
| OLD | NEW |