mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
ci: Set up CodeQL analysis w/ fixes (#1711)
* ci: Set up CodeQL analysis * spec: disable allowBackup in testing * ci: do not check cordova.js - convered in cordova-js repo * chore: add missing @Override annotation
This commit is contained in:
+12
@@ -69,30 +69,35 @@ public class BackButtonMultipageTest {
|
||||
assertEquals(START_URL, mActivity.onPageFinishedUrl.take());
|
||||
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
webInterface.sendJavascript("window.location = 'sample2.html';");
|
||||
}
|
||||
});
|
||||
assertPageSample(SAMPLE2_URL);
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
webInterface.sendJavascript("window.location = 'sample3.html';");
|
||||
}
|
||||
});
|
||||
assertPageSample(SAMPLE3_URL);
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
assertTrue(webInterface.backHistory());
|
||||
}
|
||||
});
|
||||
assertPageSample(SAMPLE2_URL);
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
assertTrue(webInterface.backHistory());
|
||||
}
|
||||
});
|
||||
assertEquals(START_URL, mActivity.onPageFinishedUrl.take());
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
assertFalse(webInterface.backHistory());
|
||||
}
|
||||
@@ -105,30 +110,35 @@ public class BackButtonMultipageTest {
|
||||
assertEquals(START_URL, mActivity.onPageFinishedUrl.take());
|
||||
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
webInterface.loadUrl(SAMPLE2_URL);
|
||||
}
|
||||
});
|
||||
assertPageSample(SAMPLE2_URL);
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
webInterface.loadUrl(SAMPLE3_URL);
|
||||
}
|
||||
});
|
||||
assertPageSample(SAMPLE3_URL);
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
assertTrue(webInterface.backHistory());
|
||||
}
|
||||
});
|
||||
assertPageSample(SAMPLE2_URL);
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
assertTrue(webInterface.backHistory());
|
||||
}
|
||||
});
|
||||
assertEquals(START_URL, mActivity.onPageFinishedUrl.take());
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
assertFalse(webInterface.backHistory());
|
||||
}
|
||||
@@ -141,12 +151,14 @@ public class BackButtonMultipageTest {
|
||||
assertEquals(START_URL, mActivity.onPageFinishedUrl.take());
|
||||
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
webInterface.loadUrl(SAMPLE2_URL);
|
||||
}
|
||||
});
|
||||
assertPageSample(SAMPLE2_URL);
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
webInterface.loadUrl(SAMPLE3_URL);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ public class ErrorUrlTest {
|
||||
assertEquals(START_URL, mActivity.onPageFinishedUrl.take());
|
||||
assertEquals(ERROR_URL, mActivity.onPageFinishedUrl.take());
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
assertEquals(ERROR_URL, mActivity.getWebInterface().getUrl());
|
||||
}
|
||||
|
||||
+1
@@ -79,6 +79,7 @@ public class MessageChannelMultipageTest {
|
||||
//load a page - this resets the plugin manager and nulls cordovaWebViewImpl.appPlugin
|
||||
//(previously this resets plugin manager but did not null cordovaWebViewImpl.appPlugin, leading to the issue)
|
||||
mActivityRule.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
cordovaWebView.loadUrl(START_URL);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:allowBackup="false"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
|
||||
+1
@@ -93,6 +93,7 @@ public class EmbeddedWebViewActivity extends AppCompatActivity {
|
||||
* @param permissions
|
||||
* @param grantResults
|
||||
*/
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String permissions[],
|
||||
int[] grantResults) {
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user