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();
}
}
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);
}
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());
}
Aggregations