mirror of
https://github.com/github/codeql.git
synced 2025-12-23 20:26:32 +01:00
update act tests
This commit is contained in:
committed by
Tony Torralba
parent
834927c50b
commit
00b0a6bf38
@@ -12,30 +12,17 @@ public class TestStartActivityToGetIntent {
|
|||||||
|
|
||||||
public void test(Context ctx, Activity act) {
|
public void test(Context ctx, Activity act) {
|
||||||
|
|
||||||
// test all methods that start an activity
|
// test methods that start an activity
|
||||||
{
|
{
|
||||||
Intent intent = new Intent(null, SomeActivity.class);
|
Intent intent = new Intent(null, SomeActivity.class);
|
||||||
intent.putExtra("data", (String) source("ctx-start"));
|
intent.putExtra("data", (String) source("ctx-start"));
|
||||||
ctx.startActivity(intent);
|
ctx.startActivity(intent);
|
||||||
}
|
}
|
||||||
{
|
|
||||||
// Intent intent1 = new Intent(null, SomeActivity2.class);
|
|
||||||
// intent1.putExtra("data", (String) source("ctx-starts"));
|
|
||||||
// Intent intent2 = new Intent(null, SomeActivity3.class);
|
|
||||||
// intent2.putExtra("data", (String) source("ctx-starts"));
|
|
||||||
// Intent[] intents = {intent1, intent2};
|
|
||||||
// ctx.startActivities(intents);
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
Intent intent = new Intent(null, SomeActivity.class);
|
Intent intent = new Intent(null, SomeActivity.class);
|
||||||
intent.putExtra("data", (String) source("act-start"));
|
intent.putExtra("data", (String) source("act-start"));
|
||||||
act.startActivity(intent);
|
act.startActivity(intent);
|
||||||
}
|
}
|
||||||
{
|
|
||||||
// Intent[] intent = {new Intent(null, SomeActivity.class)};
|
|
||||||
// intent[0].putExtra("data", (String) source("act-starts"));
|
|
||||||
// act.startActivities(intent);
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
Intent intent = new Intent(null, SomeActivity.class);
|
Intent intent = new Intent(null, SomeActivity.class);
|
||||||
intent.putExtra("data", (String) source("start-for-result"));
|
intent.putExtra("data", (String) source("start-for-result"));
|
||||||
@@ -85,22 +72,6 @@ public class TestStartActivityToGetIntent {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static class SomeActivity2 extends Activity {
|
|
||||||
|
|
||||||
// public void test() {
|
|
||||||
// sink(getIntent().getStringExtra("data")); // $ hasValueFlow=ctx-starts
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// static class SomeActivity3 extends Activity {
|
|
||||||
|
|
||||||
// public void test() {
|
|
||||||
// sink(getIntent().getStringExtra("data")); // $ hasValueFlow=ctx-starts
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
static class SafeActivity extends Activity {
|
static class SafeActivity extends Activity {
|
||||||
|
|
||||||
public void test() {
|
public void test() {
|
||||||
|
|||||||
Reference in New Issue
Block a user