mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 838636 - Guard against NPE in robocop setup; r=kats
This commit is contained in:
parent
895d08f043
commit
df9dd9145d
@ -7,19 +7,26 @@ package @ANDROID_PACKAGE_NAME@;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.test.InstrumentationTestRunner;
|
import android.test.InstrumentationTestRunner;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
public class FennecInstrumentationTestRunner extends InstrumentationTestRunner {
|
public class FennecInstrumentationTestRunner extends InstrumentationTestRunner {
|
||||||
private static Bundle sArguments;
|
private static Bundle sArguments;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle arguments) {
|
public void onCreate(Bundle arguments) {
|
||||||
super.onCreate(arguments);
|
|
||||||
sArguments = arguments;
|
sArguments = arguments;
|
||||||
|
if (sArguments == null) {
|
||||||
|
Log.e("Robocop", "FennecInstrumentationTestRunner.onCreate got null bundle");
|
||||||
|
}
|
||||||
|
super.onCreate(arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
// unfortunately we have to make this static because test classes that don't extend
|
// unfortunately we have to make this static because test classes that don't extend
|
||||||
// from ActivityInstrumentationTestCase2 can't get a reference to this class.
|
// from ActivityInstrumentationTestCase2 can't get a reference to this class.
|
||||||
public static Bundle getArguments() {
|
public static Bundle getArguments() {
|
||||||
|
if (sArguments == null) {
|
||||||
|
Log.e("Robocop", "FennecInstrumentationTestCase.getArguments returns null bundle");
|
||||||
|
}
|
||||||
return sArguments;
|
return sArguments;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user