Implement helpers and test fakes to make testing smoother.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793 commit afa8fdf6a6a9e89cbf0e46d951d28a01c3004793 Author: Justin DeWitt <dewittj@chromium.org> Date: Wed Jun 07 23:24:43 2017 [Offline Pages] Adds test classes and testing support for Prefetching. This adds the PrefetchServiceTestTaco, a helper to create a PrefetchService with mostly empty test classes in tests. Also adds the test fakes for all the objects hanging off the PrefetchService, except for SuggestedArticlesObserver which is null in tests (nothing in prefetch depends on it; it depends on the prefetch service and hangs off it for lifetime purposes. Bug: 729651 Change-Id: Ifada5c683e348e9f99b4e140c96eb992de83d4e1 Reviewed-on: https://chromium-review.googlesource.com/523282 Commit-Queue: Justin DeWitt <dewittj@chromium.org> Reviewed-by: Carlos Knippschild <carlosk@chromium.org> Cr-Commit-Position: refs/heads/master@{#477776} [modify] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/BUILD.gn [modify] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/prefetch_service.h [add] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/prefetch_service_test_taco.cc [add] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/prefetch_service_test_taco.h [modify] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/suggested_articles_observer_unittest.cc [add] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/test_offline_metrics_collector.h [add] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/test_prefetch_dispatcher.cc [add] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/test_prefetch_dispatcher.h [add] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/test_prefetch_gcm_handler.cc [add] https://crrev.com/afa8fdf6a6a9e89cbf0e46d951d28a01c3004793/components/offline_pages/core/prefetch/test_prefetch_gcm_handler.h
Comment 1 by bugdroid1@chromium.org
, Jun 7 2017