* For `PurgeHistoryUseCase` I decided to not introduce a "tab ID" parameter and instead have
it purge the history of all tabs. It seems like this is what we need and individual tab
history removal is not needed for now.
* Some tabs may not have an `EngineSession` assigned. Creating one just to call purgeHistory()
seems excessive. Instead I am dropping an attached `EngineSessionState` which will cause
those tabs to just reload the URL with not back/forward history when they get restored.
Multiple things are happening in this patch:
* `TabsUseCases` now returns the ID of new tabs instead of `Session` instances.
* `SearchUseCases` now delegates to a `TabsUseCases` instance to create tabs instead of using `SessionManager`
* Search terms have been removed from `Session` and are now only accessible on `ContentState`
* `CaptureActionsMiddleware` is a new helper to inspect actions dispatched on a `Store` in unit tests.
Running ./gradlew ktlint locally reports a lot of stuff like:
/home/emilio/src/moz/android-components/components/support/migration/src/test/java/mozilla/components/support/migration/MigrationIntentProcessorTest.kt:1:1: File must end with a newline (\n)
This fixes it with:
for f in $(cat files | cut -d : -f 1); do echo "" >> $f; done
Making ./gradlew ktlint pass.