'Helper function for test_long_output.'

def _set_data(self, browser, tab_id, items):

    history = browser.widgets()[tab_id].page().history()
    (stream, _data, user_data) = tabhistory.serialize(items)
    qtutils.deserialize_stream(stream, history)
    for (i, data) in enumerate(user_data):
        history.itemAt(i).setUserData(data)
