Overhaul ntp_snippets_service_unittest.cc.
A partial list of things done here: * Move tests that verified NTPSnippet::best_source() behavior into ntp_snippet_test.cc; they don't belong here. * Switch it to use the chromecontentsuggestions-pa. Testing new features like server-provided categories is not possible without this. * Replace MockContentSuggestionsProviderObserver with a fake. It shouldn't have been a mock, since we weren't using it to test behavior, only state. * In one case, test using what the observer sees, instead of peeking in through debugging hooks. * Get rid of special test base class and Mock::VerifyAndClear calls; I consider these anti-patterns. * Initialize the service better; give it an empty list of snippets for its first fetch, and wait for it to complete the fetch before returning (I think this is what was most strongly implicated by the failures with the other CL). * Create the service and expect the scheduling directly from each case, so they are more readable individually. Review-Url: https://codereview.chromium.org/2285133004 Cr-Commit-Position: refs/heads/master@{#415358}
Showing
This diff is collapsed.
Please register or sign in to comment