Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Issue 19616004: Add asserts to TestingProfile::CreateHistoryService to ensure files are deleted (Closed)

Created:
7 years, 5 months ago by rmcilroy
Modified:
7 years, 5 months ago
Reviewers:
sky
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add asserts to TestingProfile::CreateHistoryService to ensure files are deleted BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213148 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213413

Patch Set 1 #

Total comments: 2

Patch Set 2 : Change Asserts to Expects #

Patch Set 3 : Return success from TestingProfile::CreateHistoryService instead. #

Total comments: 2

Patch Set 4 : Add WARN_UNUSED_RESULT and assert_true in every caller. #

Total comments: 2

Patch Set 5 : Propigate CreateHistoryService return value properly #

Total comments: 7

Patch Set 6 : Final nits. #

Patch Set 7 : Identical to http://crrev.com/19616004 #

Patch Set 8 : Fix release unit tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -65 lines) Patch
M chrome/browser/autocomplete/extension_app_provider_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autocomplete/history_quick_provider_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autocomplete/history_url_provider_unittest.cc View 1 2 3 4 5 4 chunks +7 lines, -5 lines 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/autocomplete/shortcuts_provider_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/bookmarks/bookmark_html_writer_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/bookmarks/bookmark_index_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/bookmarks/bookmark_model_unittest.cc View 1 2 3 4 2 chunks +1 line, -10 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_unittest.cc View 1 2 3 4 5 6 7 8 chunks +20 lines, -10 lines 0 comments Download
M chrome/browser/download/download_target_determiner_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/history/android/android_history_provider_service_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/history/android/sqlite_cursor_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/history/history_backend_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/history/in_memory_url_index_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/history/top_sites_impl_unittest.cc View 1 2 3 6 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/history/top_sites_likely_impl_unittest.cc View 1 2 3 6 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/importer/profile_writer_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/predictors/autocomplete_action_predictor_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/profiles/profile_manager_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/malware_details_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/search_engines/template_url_service_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/bookmarks/bookmark_prompt_controller_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/base/testing_profile.h View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/test/perf/generate_profile.cc View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 16 (0 generated)
rmcilroy
The context on wanting to assert these files are deleted is that http://crrev.com/212459 got reverted ...
7 years, 5 months ago (2013-07-19 17:49:29 UTC) #1
sky
https://codereview.chromium.org/19616004/diff/1/chrome/test/base/testing_profile.cc File chrome/test/base/testing_profile.cc (right): https://codereview.chromium.org/19616004/diff/1/chrome/test/base/testing_profile.cc#newcode362 chrome/test/base/testing_profile.cc:362: ASSERT_TRUE(base::DeleteFile(path, false)); In general you shouldn't use ASSERTS in ...
7 years, 5 months ago (2013-07-19 20:04:57 UTC) #2
rmcilroy
Changed ASSERTS to EXPECTS. PTAL https://codereview.chromium.org/19616004/diff/1/chrome/test/base/testing_profile.cc File chrome/test/base/testing_profile.cc (right): https://codereview.chromium.org/19616004/diff/1/chrome/test/base/testing_profile.cc#newcode362 chrome/test/base/testing_profile.cc:362: ASSERT_TRUE(base::DeleteFile(path, false)); On 2013/07/19 ...
7 years, 5 months ago (2013-07-22 11:18:07 UTC) #3
sky
Expects won't stop test flow. You should change the return type.
7 years, 5 months ago (2013-07-22 14:53:52 UTC) #4
rmcilroy_google
On 2013/07/22 14:53:52, sky wrote: > Expects won't stop test flow. You should change the ...
7 years, 5 months ago (2013-07-22 15:47:52 UTC) #5
sky
Actually, ASSERT just returns from current caller. The problem with putting an ASSERT in CreateHistoryService ...
7 years, 5 months ago (2013-07-22 18:26:27 UTC) #6
rmcilroy
https://codereview.chromium.org/19616004/diff/16001/chrome/test/base/testing_profile.h File chrome/test/base/testing_profile.h (right): https://codereview.chromium.org/19616004/diff/16001/chrome/test/base/testing_profile.h#newcode136 chrome/test/base/testing_profile.h:136: bool CreateHistoryService(bool delete_file, bool no_db); On 2013/07/22 18:26:27, sky ...
7 years, 5 months ago (2013-07-22 22:44:17 UTC) #7
sky
https://codereview.chromium.org/19616004/diff/22001/chrome/browser/bookmarks/bookmark_model_unittest.cc File chrome/browser/bookmarks/bookmark_model_unittest.cc (right): https://codereview.chromium.org/19616004/diff/22001/chrome/browser/bookmarks/bookmark_model_unittest.cc#newcode919 chrome/browser/bookmarks/bookmark_model_unittest.cc:919: ASSERT_TRUE(profile_->CreateHistoryService(true, false)); You need to wrap all calls to ...
7 years, 5 months ago (2013-07-22 23:02:23 UTC) #8
rmcilroy
https://codereview.chromium.org/19616004/diff/22001/chrome/browser/bookmarks/bookmark_model_unittest.cc File chrome/browser/bookmarks/bookmark_model_unittest.cc (right): https://codereview.chromium.org/19616004/diff/22001/chrome/browser/bookmarks/bookmark_model_unittest.cc#newcode919 chrome/browser/bookmarks/bookmark_model_unittest.cc:919: ASSERT_TRUE(profile_->CreateHistoryService(true, false)); On 2013/07/22 23:02:23, sky wrote: > You ...
7 years, 5 months ago (2013-07-22 23:53:31 UTC) #9
sky
LGTM https://codereview.chromium.org/19616004/diff/31001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc File chrome/browser/browsing_data/browsing_data_remover_unittest.cc (right): https://codereview.chromium.org/19616004/diff/31001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc#newcode338 chrome/browser/browsing_data/browsing_data_remover_unittest.cc:338: RemoveHistoryTester() : query_url_success_(false) {} nit: member initialize history_service_ ...
7 years, 5 months ago (2013-07-23 13:59:37 UTC) #10
rmcilroy
Thanks for the quick reviews! I learned a fair bit about how gtest actually works ...
7 years, 5 months ago (2013-07-23 14:30:50 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rmcilroy@chromium.org/19616004/37001
7 years, 5 months ago (2013-07-23 14:33:14 UTC) #12
sky
https://codereview.chromium.org/19616004/diff/31001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc File chrome/browser/browsing_data/browsing_data_remover_unittest.cc (right): https://codereview.chromium.org/19616004/diff/31001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc#newcode340 chrome/browser/browsing_data/browsing_data_remover_unittest.cc:340: bool Initialize(TestingProfile* profile) WARN_UNUSED_RESULT { On 2013/07/23 14:30:50, rmcilroy ...
7 years, 5 months ago (2013-07-23 14:36:09 UTC) #13
commit-bot: I haz the power
Change committed as 213148
7 years, 5 months ago (2013-07-23 17:19:53 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rmcilroy@chromium.org/19616004/57001
7 years, 5 months ago (2013-07-24 09:22:41 UTC) #15
commit-bot: I haz the power
7 years, 5 months ago (2013-07-24 12:23:34 UTC) #16
Message was sent while issue was closed.
Change committed as 213413

Powered by Google App Engine
This is Rietveld 408576698