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

Side by Side Diff: content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java

Issue 2766393004: Convert most of the rest of instrumentation tests in content (Closed)
Patch Set: rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698