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:
エリス
2024-05-13 10:24:04 +09:00
committed by GitHub
parent 7fa4a65d0a
commit ed8e5d2f0a
18 changed files with 88 additions and 9 deletions
@@ -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());
}
@@ -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"
@@ -93,6 +93,7 @@ public class EmbeddedWebViewActivity extends AppCompatActivity {
* @param permissions
* @param grantResults
*/
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[],
int[] grantResults) {
try