Add search result type getter to all SearchProviders.
The plan for integration testing in the launcher is roughly as follows: 1. Give search providers a method to identify themselves with a search result type (<- this CL). 2. Use the getter to inform the Mixer _which_ search provider is triggering a OnResultsChanged call. 3. Add hooks into the Mixer allowing a RunLoop to wait until a list of providers have created results and called OnResultsChanged. 4. Use the RunLoop hooks to build integration tests that inspect the result of a query after all relevant providers have completed. This CL adds a getter method that lets each SearchProvider identify itself with a particular search result type. Two providers, SettingsShortcutProvider and ArcAppDataSearchProvider, don't appear to have enum entries for their result types. I've given them kUnknown for now, and we can update them if they ever need to be integration tested. Due to the asynchrony of the search backend, we need this kind of "wait until providers are done" system in order to know how long to wait for in a browser test, as browser tests don't support ScopedTasksEnvironments and the like. In future we could use this system to optimize search ranking, as we would know which results are new, and could avoid re-ranking already ranked results. Bug: 1086713 Change-Id: Icac3efaaf963a4b5e445dd0a0de8fd435fd27f61 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214736Reviewed-by:Jia Meng <jiameng@chromium.org> Commit-Queue: Tony Yeoman <tby@chromium.org> Cr-Commit-Position: refs/heads/master@{#774434}
Showing
Please register or sign in to comment