Skip to content
Commit 30016184 authored by Michael Thiessen's avatar Michael Thiessen Committed by Chromium LUCI CQ
Browse files

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: default avatarAndrew 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}
parent d44cbd33
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment