Fixed memory leak in tests.
This patch fixes memory leak in BrowsingHistoryServiceTest tests detected by ASAN build. Also changed TestingProfile to use already implemented and correct(non leaking) version of BlockUntilHistoryProcessesPendingRequests. Leaking object was QuittingHistoryDBTask which is created and passed to ScheduleDBTask function of HistoryService. To delete this object HistoryBackend posts DeletePoiner task back to original loop in ~QueuedHistoryDBTask. Yet nobody processes this task in tests and its leakage is catched by ASAN. history::BlockUntilHistoryProcessesPendingRequests in history_service_test_util.cc calls HistoryService::FlushForTest which does not create any objects in heap and is leak safe. Change-Id: I76040ab9f52656d4c92b874d24ba0bc514e6a031 Reviewed-on: https://chromium-review.googlesource.com/789112 Commit-Queue: Alexander Yashkin <a-v-y@yandex-team.ru> Reviewed-by:Brett Wilson <brettw@chromium.org> Cr-Commit-Position: refs/heads/master@{#519592}
Showing
Please register or sign in to comment