Fix test failing randomly in CI

Randomly testEmptyHistoryTokens receives an event
from testReplaceItemNoEvent, reseting the history
fragment fixes it. This only happens in htmlunit

Change-Id: Id821bf292726a66021de64257c1ca5f2c97ab9e4