Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91ed5311 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove deprecated clickCaptionsButton_logsUiEvent test" into main

parents 80b5b068 12af6ae1
Loading
Loading
Loading
Loading
+0 −28
Original line number Original line Diff line number Diff line
@@ -654,34 +654,6 @@ public class VolumeDialogImplTest extends SysuiTestCase {
        }
        }
    }
    }


    /**
     * The click should be a single tap, thus we inject a down and an up event.
     */
    @Test
    public void clickCaptionsButton_logsUiEvent() {
        UiEventLoggerFake logger = new UiEventLoggerFake();
        Events.sUiEventLogger = logger;
        MotionEvent down = MotionEventBuilder.newBuilder()
                .setAction(MotionEvent.ACTION_DOWN).build();
        MotionEvent up = MotionEventBuilder.newBuilder()
                .setAction(MotionEvent.ACTION_UP).build();

        mODICaptionsIcon.onTouchEvent(down);
        mODICaptionsIcon.onTouchEvent(up);
        mTestableLooper.moveTimeForward(300); // to confirm it was only a single tap
        mTestableLooper.processAllMessages();

        boolean foundCaptionLog = false;
        for (UiEventLoggerFake.FakeUiEvent event : logger.getLogs()) {
            if (event.eventId
                    == Events.VolumeDialogEvent.VOLUME_DIALOG_ODI_CAPTIONS_CLICKED.getId()) {
                foundCaptionLog = true;
                break;
            }
        }
        Assert.assertTrue("Did not log the captions button click.", foundCaptionLog);
    }

    /**
    /**
     * Pressing the small x button at top right dismisses the captions tooltip.
     * Pressing the small x button at top right dismisses the captions tooltip.
     */
     */