Skip to content
Snippets Groups Projects
  1. May 21, 2024
  2. May 15, 2024
    • Makoto Onuki's avatar
      Add a hidden API to detect ravenwood environment · 2850813e
      Makoto Onuki authored
      We should minimize uses of it, but once in a while,
      it's useful as a last resort.
      
      Bug: 340556010
      Test: atest FrameworksCoreTestsRavenwood:com.android.internal.ravenwood.RavenwoodEnvironmentTest
      Test: tree hugger for device side tests
      Merged-In: Ice651a55cad092514466dd56940a2cf7b2285e4e
      Change-Id: Ice651a55cad092514466dd56940a2cf7b2285e4e
      2850813e
  3. Dec 12, 2023
    • Jeff Sharkey's avatar
      Support "probing" ignored tests; more Parcel impl. · 06e55aba
      Jeff Sharkey authored
      As test authors onboard their bivalent tests, they'll be using the
      `@IgnoreUnderRavenwood` annotation to quietly ignore tests that
      don't currently have enough Ravenwood support to run.
      
      However, over time the Ravenwood environment will continue to
      gain new functionality, and we'd like an easy way to "probe" those
      previously-ignored tests to see if any of them started passing.
      
      This change implements this using a locally-configured flag
      that unconditionally runs all tests under Ravenwood, and reports
      failures for any tests marked as `@IgnoreUnderRavenwood` that
      are now passing.  (As these "failures" might be confusing for normal
      test authors, we leave it disabled by default in the build, and
      leave it for internal Ravenwood maintainers.)
      
      To confirm this works, implement two new methods on Parcel, and
      detect the relevant tests that started passing.
      
      Bug: 292141694
      Test: atest CtsUtilTestCasesRavenwood CtsUtilTestCases
      Change-Id: Ied2a5e3d1781c76a4f3506192d015309f2f424b2
      06e55aba
  4. Dec 11, 2023
    • Jeff Sharkey's avatar
      Polished Ravenwood docs. · ef0bcfb4
      Jeff Sharkey authored
      * Highlight temporary strategies for JNI.
      * Clarify current `TEST_MAPPING` status.
      * Mention `@IgnoreUnderRavenwood` support at class level.
      * Mention strategy for bivalent tests using resources.
      * Concrete example of temporary directory.
      
      Bug: 292141694
      Test: atest CtsUtilTestCasesRavenwood CtsUtilTestCases
      Change-Id: If0903296697049d248c50ab46b01b273aab26c9f
      ef0bcfb4
    • Dmitri Plotnikov's avatar
      Migrate several PowerStats tests to Ravenwood · 6d288fe1
      Dmitri Plotnikov authored
      Bug: 314797745
      Test: atest PowerStatsTestsRavenwood
      Test: atest PowerStatsTests
      
      Change-Id: I4af6e9c532285dc935f6d2156cc9cb3531d9aeaa
      6d288fe1
  5. Dec 08, 2023
    • Jeff Sharkey's avatar
      Support more `os` under Ravenwood. · 30a1ccb2
      Jeff Sharkey authored
      Tests for these internal utils are local within the frameworks/base/
      repo, instead of in CTS.
      
      To help future-proof, bring the entire os/* test directory by
      default into the Ravenwood suites, and give developers the way to
      easily opt-out with @IgnoreUnderRavenwood at the class level.
      
      Bug: 292141694
      Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests
      Change-Id: Ia3c72c22fb3ebc8cfec7a4f9811b7e27a783e885
      30a1ccb2
    • Dmitri Plotnikov's avatar
      Migrate MultiStateStatsTest to Ravenwood · 31c519f8
      Dmitri Plotnikov authored
      Bug: 314797745
      Test: atest PowerStatsTestsRavenwood
      Test: atest PowerStatsTests
      
      Change-Id: I28f823608041cc7606bd848f3618c9c0ae5adace
      31c519f8
  6. Dec 07, 2023
    • Jeff Sharkey's avatar
      Ravenwood support for feature flags. · 9ac0521c
      Jeff Sharkey authored
      Since feature flags are becoming an important part of development
      work, ensure that Ravenwood tests can use existing tools such as
      `SetFlagsRule` to populate values for code-under-test to consume.
      
      To enable this, we extend `AndroidHeuristicsFilter` to recognize
      feature flags generated code, and include that in the Ravenwood
      environment by default.
      
      Bug: 311370221
      Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests
      Change-Id: I526af65f816d153cb6e365cf6810a5a304d3e6a6
      9ac0521c
    • Jeff Sharkey's avatar
      Example system service test under Ravenwood. · d6752c92
      Jeff Sharkey authored
      This change demonstrates a moderately complex test of a specific
      system service, in this case `UriGrantsManagerService`.
      
      Bug: 292141694
      Test: atest FrameworksServicesTestsRavenwood FrameworksServicesTests
      Change-Id: Ia16632f2c9a1e24deb9c1320fdbb1c099e3d74c3
      d6752c92
  7. Dec 06, 2023
    • Jeff Sharkey's avatar
      Support more utils under Ravenwood. · 3e68053d
      Jeff Sharkey authored
      Tests for these internal utils are local within the frameworks/base/
      repo, instead of in CTS.
      
      To help future-proof, bring the entire utils/* test directory by
      default into the Ravenwood suites, and give developers the way to
      easily opt-out with @IgnoreUnderRavenwood at the class level.
      
      Bug: 292141694
      Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests
      Test: atest FrameworksUtilTestsRavenwood FrameworksUtilTests
      Change-Id: Ibcabec764efa31cc8cb4c56d7815948d4029aaea
      3e68053d
  8. Dec 05, 2023
    • Jeff Sharkey's avatar
      Support more internal utils under Ravenwood. · 256d9070
      Jeff Sharkey authored
      Tests for these internal utils are local within the frameworks/base/
      repo, instead of in CTS.
      
      To help future-proof, bring the entire utils/* test directory by
      default into the Ravenwood suites, and give developers the way to
      easily opt-out with @IgnoreUnderRavenwood at the class level.
      
      Bug: 292141694
      Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests
      Test: atest FrameworksUtilTestsRavenwood FrameworksUtilTests
      Change-Id: I5251dca752396faa77774659d0923d8cdb719830
      256d9070
  9. Dec 04, 2023
    • Makoto Onuki's avatar
      HostStubGen: Allow @Throw on @NativeSubstitutionClass native methods · 39d2c720
      Makoto Onuki authored
      Bug: 292141694
      Test: ./scripts/run-all-tests.sh
      Change-Id: If16c9abaeeefbf68acac0f90d8ef394871ce542a
      39d2c720
    • Jeff Sharkey's avatar
      `PackageManager` info objects under Ravenwood. · 013400fa
      Jeff Sharkey authored
      Many tests across the OS are already writing tests where they "mock"
      their own responses from `PackageManager`, primarily by filling in
      the "info" objects that it returns.
      
      Since these are simple data structures that primarily hold static
      data, let's opt-in under Ravenwood, so that other tests can
      construct for their own internal uses.  Complex dynamic operations,
      such as loading drawables, remain opted-out.
      
      This change brings along relevant CTS, but ignores several tests that
      currently depend on a fully-running PackageManager service.  To
      ensure we have solid coverage, new `testSimple` is added.
      
      Bug: 292141694
      Test: atest CtsContentTestCasesRavenwood
      Change-Id: Ie9682184cb5250f649426947bcf353802918ce50
      013400fa
  10. Dec 01, 2023
    • Makoto Onuki's avatar
      Add ravenwood minimum test · 2d26539c
      Makoto Onuki authored
      This helps examine what ravenwood test jars contain.
      
      Currently it's rather large:
      
      $ ll $ANDROID_HOST_OUT/testcases/RavenwoodMinimumTest/RavenwoodMinimumTest.jar
      -rw-r--r-- 1 omakoto primarygroup 2705929 Dec  1 11:06 /android/main-without-vendor/out/host/linux-x86/testcases/RavenwoodMinimumTest/RavenwoodMinimumTest.jar
      
      $ jar tvf $ANDROID_HOST_OUT/testcases/RavenwoodMinimumTest/RavenwoodMinimumTest.jar | wc -l
      2000
      
      Seems like we're pulling in even kotlin runtime classes from the
      androidx dependencies?
      
      We can move them to ravenwood-runtime.
      
      Bug: 292141694
      Test: atest --host RavenwoodMinimumTest
      
      Change-Id: Ifb939c9914ef7fa6610adb697d05369d16c76d29
      2d26539c
    • Makoto Onuki's avatar
      Update TEST_MAPPING for ravenwood · ededd7e6
      Makoto Onuki authored
      Bug: 292141694
      Test: Tree hugger
      Change-Id: Ica5cfff6bc209376ab39f665d48f992c143c49a2
      ededd7e6
  11. Nov 30, 2023
    • Jeff Sharkey's avatar
      `Parcelling` under Ravenwood. · 6e7dd796
      Jeff Sharkey authored
      General-purpose library code, along with tests.  Part of preparing
      to onboard `PackageManager` info objects.
      
      Bug: 292141694
      Test: atest InternalTestsRavenwood
      Change-Id: Idc0000151cac14bc03b4ca9bfa3000d582ee1602
      6e7dd796
  12. Nov 29, 2023
    • Jeff Sharkey's avatar
      Base support for `servicestests` under Ravenwood. · 784b36cc
      Jeff Sharkey authored
      As part of upcoming `servicestests` work, this change makes some
      general changes.
      
      We don't currently have Mainline stubs included in the Ravenwood
      runtime, so this change "hides" references in `PackageManagerInternal`
      and `ActivityManagerInternal` while keeping the clients working.
      
      Adds support for `Process.setCanSelfBackground()` to support
      ServiceThread.
      
      Adds support for `LocalServices`, along with a new hook to clear out
      any registered services between each Ravenwood test.
      
      Bug: 292141694
      Test: atest CtsUtilTestCasesRavenwood
      Change-Id: Iea3b4a5bf2ebebb34d56cfc76014fc07987cf355
      784b36cc
    • Jeff Sharkey's avatar
      `LruCache` under Ravenwood. · 7c1df35f
      Jeff Sharkey authored
      Another common utility that is valuable, along with relevant tests.
      
      Bug: 292141694
      Test: atest CtsUtilTestCasesRavenwood:LruCacheTest CtsUtilTestCases:LruCacheTest
      Change-Id: Ic2212518a61287fe1e4782075c8df20fed24f6d0
      7c1df35f
    • Jeff Sharkey's avatar
      `FileUtils` and `AtomicFile` under Ravenwood. · 299ea3e3
      Jeff Sharkey authored
      These are common utility classes used by framework code, so support
      them and their relevant tests.
      
      Since they depend on ErrnoException and IoUtils, bring over limited
      versions of those classes into `libcore-fake`, and compile them into
      the Ravenwood runtime using variant washing.
      
      Bug: 292141694
      Test: atest FrameworksCoreTestsRavenwood FrameworksUtilTestsRavenwood
      Change-Id: Ib44dedacfa4d12a7d697973caf070477ed07202d
      299ea3e3
    • Makoto Onuki's avatar
      HostStubGen: Write verbose/debug log to a file · 623cffb0
      Makoto Onuki authored
      See below for the log filename.
      
      Also disable an unimplemented flag.
      
      Bug: 311174191
      Test: ./scripts/run-all-tests.sh
      Test: m framework-minus-apex.ravenwood
          and examine console output and
          out/soong/.intermediates/frameworks/base/framework-minus-apex.ravenwood-base/android_common/gen/hoststubgen_framework-minus-apex.log
      Change-Id: I9997370c93e2fe90276d5f3e657d45d440ca0a59
      623cffb0
    • Jeff Sharkey's avatar
      Verify `android.test.mock` under Ravenwood. · de344710
      Jeff Sharkey authored
      Even though developers are encouraged to use Mockito, existing tests
      may still be using this old library for their mocking.
      
      We'll circle back later to consider support for components such as
      ContentProvider, Service, etc.
      
      Clean up OWNERS.
      
      Bug: 310268946
      Test: atest android.test.mock.ravenwood.tests
      Change-Id: Ie3f4ccea9cf6719d61cff277a627825868edc992
      de344710
  13. Nov 28, 2023
    • Jeff Sharkey's avatar
      Initial docs for Ravenwood. · 1189bfe1
      Jeff Sharkey authored
      Bug: 292141694
      Test: none
      Change-Id: Iaa8b163bf0700fa6ef5c9ef5e022b68c1a932273
      1189bfe1
    • Makoto Onuki's avatar
      Keep all AIDL generated classes · 3b0c4f80
      Makoto Onuki authored
      Also fix the AIDL class detection.
      
      Test: m framework-minus-apex.ravenwood and make sure IAccountAthenticator
        and its nested classes are all kept.
      Test: ./run-all-tests.sh
      Change-Id: Idb870a6e7558f7303a2072afbede2a868204e2bf
      3b0c4f80
  14. Nov 22, 2023
    • Makoto Onuki's avatar
      Fix build rule · a8bcba13
      Makoto Onuki authored
      Bug: 292141694
      Test: atest CtsUtilTestCasesRavenwood
      Change-Id: I4068c227b4d42b34d2a7e1e5da2032a870b3cfc2
      a8bcba13
  15. Nov 21, 2023
    • Jeff Sharkey's avatar
      Support Handler/Looper for Ravenwood, with CTS. · 1c7db6b9
      Jeff Sharkey authored
      Now that we have a solid foundation of classes available, one of the
      tricker pieces is supporting Handler/Looper under Ravenwood.  At its
      core, the native implementation of MessageQueue can be emulated using
      core JVM primitives, which is enough to reliably pass CTS.
      
      Advanced features like FileDescriptor events will need to wait until
      we eventually have real JNI support.
      
      Fix obscure bug with SystemClock; must be positive number.  Always
      start our "fake" pointers from 1 to prevent `nullptr` oddness.
      
      Bug: 292141694
      Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases
      Change-Id: I0f82b659973443968ef2609a7e3151f381abff29
      1c7db6b9
    • Jeff Sharkey's avatar
      Support simple graphics structs in Ravenwood, with CTS. · 984c23da
      Jeff Sharkey authored
      Insets, Point, PointF, Rect, and RectF are all foundational structs
      that don't rely on any complex logic, so they're prime candidates to
      support for use by Ravenwood host-side tests.
      
      Based on analysis of existing test code, they're also high-usage
      classes that would help enable many "small" tests.
      
      Bug: 292141694
      Test: atest CtsGraphicsTestCasesRavenwood CtsGraphicsTestCases
      Change-Id: I715d7e03187d651c506bd540e4d1735d56c27ec8
      984c23da
    • Jeff Sharkey's avatar
      Support Account for Ravenwood, with CTS. · e1bdce79
      Jeff Sharkey authored
      Support single simple tuple class in Ravenwood.
      
      Bug: 292141694
      Test: atest-dev CtsAccountManagerTestCasesRavenwood CtsAccountManagerTestCases
      Change-Id: I877cce30d180e87c9715391fb488bc7313156bea
      e1bdce79
  16. Nov 20, 2023
    • Jeff Sharkey's avatar
      More `android.util` internals, with tests. · ce9f0d06
      Jeff Sharkey authored
      Internal test authors are likely going to want to use internal
      utilities that aren't in the official API surface.  This change adds
      those to Ravenwood, along with local tests to confirm they work.
      
      Bug: 292141694
      Test: atest-dev FrameworksUtilTestsRavenwood
      Change-Id: I0f4df50416d153418d4525bd8ec5c4dbf04521a2
      ce9f0d06
  17. Nov 16, 2023
    • Jeff Sharkey's avatar
      Support TextUtils for Ravenwood, with CTS. · cb4a047e
      Jeff Sharkey authored
      A handful of TextUtils utility methods are fully supportable on a
      typical host JVM, so this change marks them as being available.  It
      also brings along the relevant CTS to ensure consistency with how
      a real device behaves.
      
      Bug: 292141694
      Test: atest-dev CtsTextTestCasesRavenwood CtsTextTestCases
      Change-Id: I460719c67ac4bde9e8baee0ac72d3062401d7d67
      cb4a047e
    • Jeff Sharkey's avatar
      Build `ravenwood-junit` against `test_current`. · 41cfbb3f
      Jeff Sharkey authored
      Some CTS tests desire to link against `test_current` to prove to
      themselves that they're not touching hidden APIs.  This means if they
      also want to use our `ravenwood-junit` rules, that dependency also
      needs to link against `test_current`.
      
      Since we're reaching down into plenty of hidden details when we're
      actually running on a Ravenwood runtime, we split into a `stub` and
      an `impl` library, so that we give a cleanly compiling library to
      to clients, which is then replaced under the Ravenwood runtime.
      
      Bug: 292141694
      Test: atest-dev CtsTextTestCasesRavenwood CtsTextTestCases
      Change-Id: I96dbc9643324a7853a992e97b51a88f70eb721f3
      41cfbb3f
  18. Nov 15, 2023
    • Jeff Sharkey's avatar
      Remind ourselves why @IgnoreUnderRavenwood. · 36b2f512
      Jeff Sharkey authored
      To aid future auditing, and determining which tests might be
      ready to enable, support adding blockedBy and/or reason to
      the @IgnoreUnderRavenwood annotation.  Apply to most of our
      existing usages in tests.
      
      Bug: 292141694
      Test: atest-dev CtsUtilTestCasesRavenwood CtsProtoTestCasesRavenwood CtsOsTestCasesRavenwood CtsContentTestCasesRavenwood CtsDatabaseTestCasesRavenwood
      Change-Id: I8807c44013f8f029844de641b43804ecf3766acb
      36b2f512
    • Jeff Sharkey's avatar
      Support android.database for Ravenwood, with CTS. · 2acaa723
      Jeff Sharkey authored
      Initial pass at foundational classes under android.database, along
      with CTS to verify consistency.
      
      Unfortunately much of the CTS is structured as integration tests,
      when it'd be possible to verify behavior as unit tests using
      simpler tools like MatrixCursor.  This change makes an effort at
      supporting existing tests using MatrixCursor where simple to adapt,
      but future changes will likely need to add more dedicated coverage.
      
      Bug: 292141694
      Test: atest-dev CtsDatabaseTestCasesRavenwood CtsDatabaseTestCases
      Change-Id: I63c568fc2bcb9d7c1ac1f2a251442fec44a0d19a
      2acaa723
    • Jeff Sharkey's avatar
      [1/?] Support android.content for Ravenwood. · 73067713
      Jeff Sharkey authored
      Initial pass at foundational classes under android.content, along
      with CTS to verify consistency.
      
      Methods that interface to broader parts of OS remain marked as
      "throw" for the moment, such as cross-process work and StrictMode.
      
      Bug: 292141694
      Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases
      Test: atest-dev CtsContentTestCasesRavenwood CtsContentTestCases
      Change-Id: Ic3deafb1f4058fcc104882a3508728994669f7d2
      73067713
    • Jeff Sharkey's avatar
      PersistableBundle for Ravenwood, with CTS. · 4ee8a655
      Jeff Sharkey authored
      We have the XML interfaces from libcore, but the implementations
      there are tied closely to things like StringPool.  We thankfully
      have our own human-readable XML serializer that we could use, but
      there's unfortunately not a good pull parser.
      
      To get us unstuck for the moment, pivot the internals to
      unconditionally use the binary XML format, which at least we
      know is thoroughly tested, and any data written through this path
      can then also be parsed.
      
      This is enough to support PersistableBundle, and we'll circle back
      to get ourselves a human-readable XML implementation in the future.
      
      Bug: 292141694
      Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases
      Change-Id: I875a3a2b0e95e52861afe187e2a5e9f1e740d8d5
      4ee8a655
  19. Nov 13, 2023
    • Jeff Sharkey's avatar
      More android.os work for Ravenwood, with CTS. · 9e4b2c12
      Jeff Sharkey authored
      Bring along simple UID math utility methods, and the ability to
      detect 32-vs-64-bit environments.
      
      Bug: 292141694
      Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases
      Change-Id: I5f3841dbe5cae703facc9020ba8c5405aa3ebcae
      9e4b2c12
    • Makoto Onuki's avatar
      Ravenwood: Add device test to RavenwoodMockitoTest · 88ea9ba9
      Makoto Onuki authored
      Test: atest RavenwoodMockitoTest RavenwoodMockitoTest_device
      Bug: 310268946
      Bug: 292141694
      Change-Id: Iaf0f689d5513a1a4dce4d756aad2152202d72e6d
      88ea9ba9
    • Jeff Sharkey's avatar
      Initial Process and Binder support, with CTS. · 5e210d7d
      Jeff Sharkey authored
      The Ravenwood environment doesn't support IPC, but much of the code
      that developers intend to test (such as AIDL stubs) still relies on
      baseline same-process behavior to be intact.
      
      This change adds UID and PID support to Process and Binder, but we
      carefully communicate that it's only available when the test author
      has configured it via a RavenwoodRule.  This ensures that tests
      don't accidentally rely on unexpected defaults, as some tests will
      want AID_SYSTEM, and others want a normal app UID.
      
      Also bring along SystemClock, PatternMatcher, and ParcelUuid
      along with relevant tests.
      
      Finally, now that we have an IgnoreUnderRavenwood annotation, we
      can pivot back our default failure to be a RuntimeException instead
      of an AssumptionViolatedException.
      
      Bug: 292141694
      Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases
      Change-Id: I5f54c3179b2d305b9ab9144c43fd063c6b756e44
      5e210d7d
  20. Nov 10, 2023
Loading