Clean up ActivityTestRule inheritance
The pattern of: Statement selfStatement = { <before> base.evaluate(); <after> } return super.apply(selfStatement, description); is counter-intuitive in derived test rule classes, because |base| is not the parent class's statement. super.apply causes the statements to be chained, not extended like normal inheritance, so if there are ordering dependencies in inherited test rules it's difficult to manage them and reason about them. Much simpler and less boilerplate to use ExternalResource's before/after. Change-Id: I0ea1e9348d9ab06e1bf8e5dfabdebac6e948803f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5605668 Reviewed-by:Andrew Grieve <agrieve@chromium.org> Owners-Override: Andrew Grieve <agrieve@chromium.org> Commit-Queue: Michael Thiessen <mthiesse@chromium.org> Cr-Commit-Position: refs/heads/main@{#1312987}
Loading
Please register or sign in to comment