Search in sources :

Example 1 with SystemWebView

use of org.apache.cordova.engine.SystemWebView in project cordova-android by apache.

the class StandardActivityTest method startUriIntentCheck.

@Test
public void startUriIntentCheck() {
    StandardActivity activity = (StandardActivity) mActivityRule.getActivity();
    final SystemWebView webView = (SystemWebView) activity.getWindow().getCurrentFocus();
    try {
        mActivityRule.runOnUiThread(new Runnable() {

            @Override
            public void run() {
                String uri = webView.getUrl();
                assertFalse(uri.equals(FALSE_URI));
            }
        });
    } catch (Throwable throwable) {
        throwable.printStackTrace();
    }
}
Also used : SystemWebView(org.apache.cordova.engine.SystemWebView) Test(org.junit.Test)

Example 2 with SystemWebView

use of org.apache.cordova.engine.SystemWebView in project cordova-android by apache.

the class StandardActivityTest method checkBackgroundIntentCheck.

@Test
public void checkBackgroundIntentCheck() {
    StandardActivity activity = (StandardActivity) mActivityRule.getActivity();
    final SystemWebView webView = (SystemWebView) activity.getWindow().getCurrentFocus();
    CordovaWebView webInterface = webView.getCordovaWebView();
    CordovaPreferences prefs = webInterface.getPreferences();
    assertFalse(prefs.getInteger("backgroundcolor", Color.BLACK) == Color.GREEN);
}
Also used : SystemWebView(org.apache.cordova.engine.SystemWebView) CordovaWebView(org.apache.cordova.CordovaWebView) CordovaPreferences(org.apache.cordova.CordovaPreferences) Test(org.junit.Test)

Example 3 with SystemWebView

use of org.apache.cordova.engine.SystemWebView in project cordova-android by apache.

the class EmbeddedWebViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    //Set up the webview
    ConfigXmlParser parser = new ConfigXmlParser();
    parser.parse(this);
    SystemWebView webView = (SystemWebView) findViewById(R.id.cordovaWebView);
    webInterface = new CordovaWebViewImpl(new SystemWebViewEngine(webView));
    webInterface.init(cordovaInterface, parser.getPluginEntries(), parser.getPreferences());
    webView.loadUrl(parser.getLaunchUrl());
}
Also used : SystemWebView(org.apache.cordova.engine.SystemWebView) SystemWebViewEngine(org.apache.cordova.engine.SystemWebViewEngine) ConfigXmlParser(org.apache.cordova.ConfigXmlParser) CordovaWebViewImpl(org.apache.cordova.CordovaWebViewImpl)

Aggregations

SystemWebView (org.apache.cordova.engine.SystemWebView)3 Test (org.junit.Test)2 ConfigXmlParser (org.apache.cordova.ConfigXmlParser)1 CordovaPreferences (org.apache.cordova.CordovaPreferences)1 CordovaWebView (org.apache.cordova.CordovaWebView)1 CordovaWebViewImpl (org.apache.cordova.CordovaWebViewImpl)1 SystemWebViewEngine (org.apache.cordova.engine.SystemWebViewEngine)1