Skip to content
Snippets Groups Projects
Forked from Dhina17 / platform_frameworks_base
Source project has a limited visibility.
  • Jeff Sharkey's avatar
    c91451a6
    Offer `TestLooperManager` on Ravenwood. · c91451a6
    Jeff Sharkey authored
    Common test utilities like `TestableLooper` rely on being able to
    drive `Looper` interactions via `TestLooperManager` which can only
    be obtained via `Instrumentation`.
    
    This change integrates with the common `InstrumentationRegistry`
    library which is how most tests obtain their `Instrumentation`
    instance.  We play an odd dance with `java_host_for_device` and
    `java_device_for_host` to get a version of `androidx.test.monitor`
    that we can link against our runtime.  (The build system otherwise
    gets excited that we're trying to compile an Android-linked library
    into what appears to be a Java-linked library, but we know that we're
    offering the Android runtime.)
    
    Fix subtle bug in `MessageQueue_host` where a requested wake might
    race with the `for (;;)` loop in `MessageQueue.next()`; if a wake is
    pending, it's a valid reason to return from `nativePollOnce()`.
    
    Add timeout logic to `RavenwoodRuleImpl` which can be enabled to
    dump all our stack traces just before Tradefed times out, to aid in
    debugging deadlocks; disabled by default.
    
    Bug: 319647875
    Test: atest SystemUiRoboTests
    Test: atest SystemUiRavenTests
    Test: atest FrameworksCoreTestsRavenwood:TestLooperManagerTest
    Change-Id: I13605d32df0c3e6758f541d5e75a6bdaf44368db
    c91451a6
    History
    Offer `TestLooperManager` on Ravenwood.
    Jeff Sharkey authored
    Common test utilities like `TestableLooper` rely on being able to
    drive `Looper` interactions via `TestLooperManager` which can only
    be obtained via `Instrumentation`.
    
    This change integrates with the common `InstrumentationRegistry`
    library which is how most tests obtain their `Instrumentation`
    instance.  We play an odd dance with `java_host_for_device` and
    `java_device_for_host` to get a version of `androidx.test.monitor`
    that we can link against our runtime.  (The build system otherwise
    gets excited that we're trying to compile an Android-linked library
    into what appears to be a Java-linked library, but we know that we're
    offering the Android runtime.)
    
    Fix subtle bug in `MessageQueue_host` where a requested wake might
    race with the `for (;;)` loop in `MessageQueue.next()`; if a wake is
    pending, it's a valid reason to return from `nativePollOnce()`.
    
    Add timeout logic to `RavenwoodRuleImpl` which can be enabled to
    dump all our stack traces just before Tradefed times out, to aid in
    debugging deadlocks; disabled by default.
    
    Bug: 319647875
    Test: atest SystemUiRoboTests
    Test: atest SystemUiRavenTests
    Test: atest FrameworksCoreTestsRavenwood:TestLooperManagerTest
    Change-Id: I13605d32df0c3e6758f541d5e75a6bdaf44368db
Code owners
Assign users and groups as approvers for specific file changes. Learn more.