FileDocCategorySizeDatePackage
JavaBridgeFieldsTest.javaAPI DocAndroid 5.1 API4006Thu Mar 12 22:22:44 GMT 2015com.android.webviewtests

JavaBridgeFieldsTest

public class JavaBridgeFieldsTest extends JavaBridgeTestBase
Part of the test suite for the WebView's Java Bridge. This test tests the use of fields. To run this test ... adb shell am instrument -w -e class com.android.webviewtests.JavaBridgeFieldsTest \ com.android.webviewtests/android.test.InstrumentationTestRunner

Fields Summary
TestObject
mTestObject
Constructors Summary
Methods Summary
protected java.lang.StringexecuteJavaScriptAndGetStringResult(java.lang.String script)

        executeJavaScript("testObject.setStringValue(" + script + ");");
        return mTestObject.waitForStringValue();
    
protected voidsetUp()


    
         
        super.setUp();
        mTestObject = new TestObject();
        setUpWebView(mTestObject, "testObject");
    
public voidtestFieldTypes()

        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.booleanField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.byteField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.charField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.shortField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.intField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.longField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.floatField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.doubleField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.objectField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.stringField"));
        assertEquals("undefined",
                executeJavaScriptAndGetStringResult("typeof testObject.customTypeField"));