use of com.ichi2.anki.reviewer.AutomaticAnswerSettings in project Anki-Android by ankidroid.
the class AbstractFlashcardViewerTest method noAutomaticAnswerAfterRenderProcessGoneAndPaused_issue9632.
@Test
public void noAutomaticAnswerAfterRenderProcessGoneAndPaused_issue9632() {
ActivityController<NonAbstractFlashcardViewer> controller = getViewerController(true);
NonAbstractFlashcardViewer viewer = controller.get();
viewer.mAutomaticAnswer = new AutomaticAnswer(viewer, new AutomaticAnswerSettings(AutomaticAnswerAction.BURY_CARD, true, 5, 5));
viewer.executeCommand(ViewerCommand.COMMAND_SHOW_ANSWER);
assertThat("messages after flipping card", viewer.hasAutomaticAnswerQueued(), equalTo(true));
controller.pause();
assertThat("disabled after pause", viewer.mAutomaticAnswer.isDisabled(), is(true));
assertThat("no auto answer after pause", viewer.hasAutomaticAnswerQueued(), equalTo(false));
viewer.mOnRenderProcessGoneDelegate.onRenderProcessGone(viewer.getWebView(), mock(RenderProcessGoneDetail.class));
assertThat("no auto answer after onRenderProcessGone when paused", viewer.hasAutomaticAnswerQueued(), equalTo(false));
}
Aggregations