Age | Commit message (Collapse) | Author |
|
Bug: 339459903
Test: mma
Merged-In: I7ee2de434aac767aa009bb0367580618690cb786
Change-Id: I7ee2de434aac767aa009bb0367580618690cb786
|
|
`DynamicRefTable` when the data type is invalid.
When the data type is invalid, it would make sense to return the corresponding bad code instead of throw an exception.
PiperOrigin-RevId: 631864822
|
|
Bug: 330075029
Test: mma
Change-Id: I12d2ce1a7889d3b6e20496639391e205eeddff06
|
|
Perform more cleanup related to the move to a minimum supported SDK of lollipop (21)
missed in last commit (c577257599dc30cf283f8961c286d4ef65e799cb):
- Remove methods with a maxSdk of JELLY_BEAN*
- Remove RuntimeEnvironment.castNativePtr and associated Number to long conversions
- Set default manifest minSdkVersion and targetSdkVersion to 21
- Remove if checks for apiLevel that are now redundant
- Remove redundant Config(minSdk = LOLLIPOP) statements
PiperOrigin-RevId: 628203572
|
|
Change-Id: Ic6cfe2bf398c32bb4ce8750dbec7f95bd2645f44
|
|
With the support of ARSC loading, some pointers potentially become null. This CL fixes this.
PiperOrigin-RevId: 625839793
|
|
Change-Id: If1ded0da6c081dd2c72e2ec28169255b23388103
|
|
|
|
branch and android
Test: CI
Bug: 329927152
Change-Id: I73a9832b68fa96feb728488cd42ae12779537c3f
|
|
Pulling updates from Github to Android
Bug: 323922587
Test: mma && atest CtesqueRoboTests
Change-Id: I09cbfb2246c40f333819959e5faf6de3b0567bdd
|
|
The `getMinSdkVersion()` and `getTargetSdkVersion()` were outdated, saying that the default value is Jelly Bean, instead of KitKat
|
|
This serves one step of supporting Material You Colors on Robolectric, since the device version of Material You Colors loads a bespoke ARSC file.
PiperOrigin-RevId: 613340893
|
|
See https://errorprone.info/bugpattern/UnnecessaryParentheses.
Signed-off-by: utzcoz <utzcoz@outlook.com>
|
|
The global scheduler is broken and will be removed soon.
PiperOrigin-RevId: 606482645
|
|
In the main loop of CppAssetManager2.RebuildFilterList, each ResTable_config
object was cloned before the match function, which was unnecessary if the
ResTable_config was not a match. During the filter process, the majority of
entries are not matches (only around 100 out of ~4000 are matches).
This caused allocation of ~4000 ResTable_config objects each time, even though
only a small fraction matched.
Update the logic to only make a copy if the match is successful.
This makes RebuildFilterList around 6x faster. In the added benchmark, the
time of the benchmark went from around 6s -> 1s.
PiperOrigin-RevId: 606294716
|
|
There is some concern this method is a bottleneck in certain types of test
classes, such as parameterized tests that generate a lot of test methods.
RebuildFilterList iterates over all resource table entries and determines if
they match a particular configuration. The time complexity of RebuildFilterList
os O(# of system resource config entries + # of app resource config entries).
At a minimum it will iterate over ~4k+ resource table config entries for SDK
34. It currently is invoked at least 9 times per test method that initializes
am Application, and more if RuntimeEnvironment.setQualifiers is called.
PiperOrigin-RevId: 605110482
|
|
|
|
Change-Id: I3b461f268555bfd37fe8bb135e097b967d70ad17
|
|
Signed-off-by: utzcoz <utzcoz@outlook.com>
|
|
Robolectric's AndroidManifest parser has now long obsolete logic that
interpret targetSdkVersion=O as 26. This commit removes that logic.
PiperOrigin-RevId: 585739314
|
|
Users using the Android Gradle Plugin currently need to
specify testOptions.unitTests.includeAndroidResources = true
for Robolectric to have access to AndroidManifest and other
Android resources.
Without this config setting, users may see cryptic errors
at runtime like "Unable to resolve activity for Intent "
when launching an Activity.
This commit adds an additional console message when AndroidManifest
cannot be found, to instruct that AGP users may want to add
the includeAndroidResources config option.
PiperOrigin-RevId: 585734701
|
|
Change-Id: I35ea66f33f8f625f4f7758935dfc39aaee07b386
|
|
There were two issues when using AttributeSetBuilder with sparse resource table
encoding. The first was that the offset to the sparse table index was not
taking the header size into account. The second issue was that when a matching
sparse entry was located, it was returning the entry number, not the entry
index, which requires a lookup in the sparse entry index.
Fixes #8578
PiperOrigin-RevId: 578082446
|
|
Test: (Both tested in `main`)
atest -c SystemUIGoogleRoboRNGTests
atest -c CtesqueRoboTests
Change-Id: I823a9cbac4fdcb9ccba8f07bf452e1e4375ff96c
|
|
Now that Robolectric supports SDK 34, increment existing integration tests
to target and compile against it.
Also update targetSdkVersion in manifests from 16 to 19.
This also required a couple additional changes:
- use native graphics mode for androidx_test. With targetSdk 34, legacy
graphics mode resulted in 0 width views
- Specify an intent filter for androidx_test Activity. Otherwise IntentsTest
will fail with 'No activities found', because the AppsFilter will block
access to other apps.
PiperOrigin-RevId: 574287184
|
|
Currently Robolectric will select binary resources mode if and only if there
is a binary resources file present. Legacy resources mode is not supported on
Android SDKs greater than P. Thus if a test setup doesn't have a binary
resources file, and is executed on a SDK > P, Robolectric will skip executing
the test.
This commit changes Robolectric behavior so that:
- binary resources mode is preferred by default.
- Support no resources in binary resources mode by defaulting manifest values,
similar to the legacy resource logic.
- Fail a test if legacy resource mode is selected when running on SDKs > P.
A future change, at a TBD date, will remove legacy resources mode support entirely.
Fixes #7249
PiperOrigin-RevId: 573243275
|
|
AttributeSetBuilder uses CppAssetManager, which did not support compact
resource table entries.
PiperOrigin-RevId: 573103527
|
|
Bug: 255714762
Test: presubmit
Change-Id: Ib9c467d448309f1d0fce3f86289a2e85bea15b3b
|
|
Update ShadowDateIntervalFormat due to DataIntervalFormat class moved to a diff package
PiperOrigin-RevId: 569516571
|
|
First update after robolectic is sync through AOSP
Bug: 283664894
Test: mma && atest MyRoboTests
Change-Id: Id719d7f3e74a8df514d58df8c84177421bf96d64
|
|
Previously there was a per-sandbox cache for ApkAssets objects that was stored
redundantly in both ShadowArscApkAssets9 and ShadowArscAssetManager{9,10}.
However, with the proliferation of sandbox parameters (looper modes, graphics
modes, instrumentation configuration), and the increase in size of system
resource tables, system resource blobs began to dominate the memory consumption
of test processes. This problem was especially salient in large multi-sdk test
processes common in Gradle environments.
Switch to using a global cache for system resources. This will reduce overall
memory consumption for tests that initialize a lot of sandboxes. It also makes
it possible for ApkAssets objects to be collected (though the underlying
CppApkAssets will not be collected). If necessary, there could be logic to
clear this cache when sandboxes of a certain SDK level are evicted from the
SandboxManager cache.
For #7359
For #8432
PiperOrigin-RevId: 561711131
|
|
Included most recent Robolectric updates and code that can be compiled for different SDK versions
Bug: 293573045
Test: mma
Change-Id: Icc3cc550589b47266a87e64ba27040fa1ebb1032
|
|
This is necessary to support android U, where framework resources use sparse encoding.
PiperOrigin-RevId: 535691220
|
|
Test: atest -c MyRoboTests
Bug: 284193357
Change-Id: I493c1e89a6b0d179477e9be4427235aa789d5051
|
|
This commit updates Robolectric support with
the transliterated latest logic from [AOSP](https://cs.android.com/android/platform/superproject/+/master:frameworks/base/libs/androidfw/LoadedArsc.cpp;drc=18c66d8fee0e0dd8681182a59b59119a21e09c0c;l=357)
This is needed because android U uses sparse encoding for framework resources.
Fixes ResourcesTest#getIdentifier_material on U.
PiperOrigin-RevId: 534882855
|
|
Test: atest -c MyRoboTests
Bug: 281899632
Change-Id: Ic205da6e976c3c7cb1b91c332ddfd22d906ffe51
|
|
Fix #7196
|
|
|
|
Support to use AppComponentFactory in Robolectric from SDK 28.
This CL only supports BroadcastReceiver with custom AppComponentFactory.
In Robolectric, developers use Robolectric#setupService or
Robolectric#buildService to initialize Service instance,
and these methods are static, so it's difficult to leverage
custom AppComponentFactory to initialize Service instance
with custom constructor. And I don't find proper usage
scenarios to use custom AppComponentFactory to initialize
ContentProvider, Application, Activity and ClassLoader.
So I leave them as not implemented state.
Signed-off-by: utzcoz <utzcoz@outlook.com>
|
|
Test: Presubmit.
Bug: 266743146
Change-Id: I7a583eb7b025a1ac75733eebd273de3582d1fa02
|
|
Add support for a ResTable type chunk encoded using FLAG_OFFSET16 and a
ResTable entry type chunk encoded using FLAG_COMPACT.
Test: atest BackupFrameworksServicesRoboTests
Test: atest ClockworkSettingsRoboTests
Test: atest PixelSetupWizardRoboTests
Bug: 275572186
Merged-In: I4e3e6139c76f016dcdec645fa1d1dabd095bde14
Merged-In: I80ab246501e72bcf5a07724dba6bf22d7b94d1a2
Change-Id: I80ab246501e72bcf5a07724dba6bf22d7b94d1a2
|
|
This is to support a preliminary option in AAPT2 to enable more compact
resource tables.
Add support for a ResTable type chunk encoded using FLAG_OFFSET16 and a
ResTable entry type chunk encoded using FLAG_COMPACT.
PiperOrigin-RevId: 521855080
|
|
|
|
This is a pure naming change made by find/replace in bash.
The current binary resources system is transliterated from C++ code, and
changes often trigger Lint errors.
Long-term the naming and spacing should be updated to follow Java
conventions.
|
|
|
|
Bug: 263483214
Test: atest -c MyRoboTests
Change-Id: Idf85ceeb3e0b4b18dfc2eb36e10f22b254fca400
|
|
Bumps [compile-testing](https://github.com/google/compile-testing) from 0.19 to 0.21.0.
- [Release notes](https://github.com/google/compile-testing/releases)
- [Commits](https://github.com/google/compile-testing/compare/compile-testing-0.19...v0.21.0)
---
updated-dependencies:
- dependency-name: com.google.testing.compile:compile-testing
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
|
|
Bug: 261732603
Test: mma in /external/robolectric
Change-Id: I83798f09a58fccd3cd654606b72e4603c64c9f75
|
|
|
|
When zip files contain more than 2**16 entries, the regular EOCD is
not sufficient to describe the number of files in the archive, and
a Zip64 EOCD needs to be written.
When a Zip64 EOCD is written, some zip libraries write -1 for many
of the fields in the regular EOCD, including the offset to central dir:
From APPNOTE.TXT §4.4.1.4
If one of the fields in the end of central directory
record is too small to hold required data, the field SHOULD be
set to -1 (0xFFFF or 0xFFFFFFFF) and the ZIP64 format record
SHOULD be created.
Previously FileMap assumed that the regular EOCD contained a valid
offset to central dir field. This broke recently when an experimental
Android SDK had more than 64k entries in the zip file and -1 for the
offset to the central dir.
Add support for reading the offset to the central from the Zip64 EOCD.
Also add a test case that generates a problematic zip file.
PiperOrigin-RevId: 492538213
|