mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
Fix tests affected by Robolectric's constructor visibility bug
Previously, Robolectric's instrumentation updated all constructors to be
public. This caused two main types of problems:
1) When non-public constructors were made public and added to the Android API,
Robolectric allowed tests to incorrectly use the constructors on older SDK
levels (where they were non-public). This most commonly occurs for
AccessibiltyEvent and AccessibilityNodeInfo.
2) When reflection was used to instantiate classes that were instrumented by
Robolectric, all constructors were accessible.
Fix issues across Google3 Robolectric tests that were affected by this issue.
A forthcoming change will fix the instrumentation in Robolectric to prevent
this type of issue from occurring.
Tested:
TAP --sample ran all affected tests and none failed
http://test/OCL:507861075:BASE:507805409:1675803313108:f2128fa4
PiperOrigin-RevId: 508087822
This commit is contained in:
parent
a39b9d9175
commit
6c7dddbd7f
1 changed files with 1 additions and 0 deletions
|
|
@ -192,6 +192,7 @@ public class AsynchronousMediaCodecAdapterTest {
|
|||
Constructor<MediaCodec.CodecException> constructor =
|
||||
MediaCodec.CodecException.class.getDeclaredConstructor(
|
||||
Integer.TYPE, Integer.TYPE, String.class);
|
||||
constructor.setAccessible(true);
|
||||
return constructor.newInstance(
|
||||
/* errorCode= */ 0, /* actionCode= */ 0, /* detailMessage= */ "error from codec");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue