sailfishos / sailfish-browser

Sailfish Browser
https://github.com/sailfishos/sailfish-browser/wiki/Sailfish-Browser-wiki
Mozilla Public License 2.0
305 stars 86 forks source link

[tests] Stabilize declarativehistorymodel test case. Fixes JB#57681 #994

Closed llewelld closed 2 years ago

llewelld commented 2 years ago

The history model orders entries first by date descending, followed by url alphabetical ascending. Consequently if the time ticks over a second while the entries are added, the ordering can change.

Removing the entries by url rather than by index ensures the tests don't fail in case this happens.

As an alternative we could change the urls to force the correct order, but then the tests would rely on potentially brittle DBWorker behaviour (the returned ordering), so avoiding direct use of the index seemed preferable.

The tests successfully ran 100 cycles without failure after the change.