Commit a315b848 authored by Robbie McElrath's avatar Robbie McElrath Committed by Commit Bot

Fix TracingSettingsTest.testRecordTrace issue on newer AndroidX versions

testRecordTrace calls Preference#performClick to simulate a button
click, which doesn't work on newer versions of the AndroidX preference
library because clicks are ignored if the preference isn't selectable.
This particular method also deosn't appear to be part of the public API.
This CL replaces the performClick call with a call to the Preference's
OnPreferenceClickListener, which correctly simulates a button click.

Bug: 1092986
Change-Id: I1be5c20c9ee020dce63f584dab754642593ddf45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2240397Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#777224}
parent 60abfd5e
......@@ -167,7 +167,7 @@ public class TracingSettingsTest {
Assert.assertEquals(TracingSettings.MSG_START, startTracingButton.getTitle());
// Tap the button to start recording a trace.
startTracingButton.performClick();
startTracingButton.getOnPreferenceClickListener().onPreferenceClick(startTracingButton);
Assert.assertEquals(
TracingController.State.STARTING, TracingController.getInstance().getState());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment