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

Issue 11419041: Add tests for redirect responses from SafeBrowsingProtocolManager. (Closed)

Created:
8 years, 1 month ago by cbentzel
Modified:
8 years ago
Reviewers:
mattm
CC:
chromium-reviews
Visibility:
Public.

Description

Add tests for redirect responses from SafeBrowsingProtocolManager. This also fixes two corner-case bugs discovered along the way: a) If the final redirect response is empty, UpdateFinished() is never called on SafeBrowsingService. b) If the last redirect response takes longer to persist the chunks to the database than the interval to the next update, the next update will start before the previous one completed. BUG=158246, 161550, 161551 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=174269

Patch Set 1 #

Patch Set 2 : Remove timeout_timer #

Patch Set 3 : Some fixes from self-review #

Patch Set 4 : Reintroduce newline #

Total comments: 2

Patch Set 5 : Tests to make sure that another update is scheduled #

Patch Set 6 : Fix issue #

Patch Set 7 : Change some tests #

Patch Set 8 : Use a helper UpdateFinished #

Total comments: 1

Patch Set 9 : Merge with trunk #

Patch Set 10 : Free chunks in test #

Total comments: 12

Patch Set 11 : Merge #

Patch Set 12 : Respond to review #

Patch Set 13 : Merge #

Total comments: 2

Patch Set 14 : Add an is_null check #

Patch Set 15 : Merge #

Patch Set 16 : Another merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+326 lines, -69 lines) Patch
M chrome/browser/safe_browsing/database_manager.h View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/safe_browsing/database_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +13 lines, -8 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_manager.h View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +19 lines, -5 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_manager.cc View 1 2 3 4 5 6 7 11 chunks +24 lines, -20 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 12 chunks +265 lines, -32 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
cbentzel
8 years, 1 month ago (2012-11-16 21:08:54 UTC) #1
mattm
http://codereview.chromium.org/11419041/diff/6001/chrome/browser/safe_browsing/protocol_manager.cc File chrome/browser/safe_browsing/protocol_manager.cc (right): http://codereview.chromium.org/11419041/diff/6001/chrome/browser/safe_browsing/protocol_manager.cc#newcode289 chrome/browser/safe_browsing/protocol_manager.cc:289: if (chunk_request_urls_.empty() && !chunk_pending_to_write_ && so if we hit ...
8 years, 1 month ago (2012-11-16 21:48:46 UTC) #2
cbentzel
http://codereview.chromium.org/11419041/diff/6001/chrome/browser/safe_browsing/protocol_manager.cc File chrome/browser/safe_browsing/protocol_manager.cc (right): http://codereview.chromium.org/11419041/diff/6001/chrome/browser/safe_browsing/protocol_manager.cc#newcode289 chrome/browser/safe_browsing/protocol_manager.cc:289: if (chunk_request_urls_.empty() && !chunk_pending_to_write_ && On 2012/11/16 21:48:46, mattm ...
8 years, 1 month ago (2012-11-16 21:52:35 UTC) #3
cbentzel
Ah - you are right, and fantastic catch! This is not checked in the unit ...
8 years, 1 month ago (2012-11-16 21:53:53 UTC) #4
cbentzel
OK, finally got back to this. I fixed the restart logic and added checks for ...
8 years ago (2012-11-30 11:24:23 UTC) #5
mattm
Still reviewing, but the diff for the unittest gets mangled pretty badly due to removing ...
8 years ago (2012-12-05 23:58:10 UTC) #6
mattm
https://codereview.chromium.org/11419041/diff/9/chrome/browser/safe_browsing/protocol_manager_unittest.cc File chrome/browser/safe_browsing/protocol_manager_unittest.cc (right): https://codereview.chromium.org/11419041/diff/9/chrome/browser/safe_browsing/protocol_manager_unittest.cc#newcode355 chrome/browser/safe_browsing/protocol_manager_unittest.cc:355: EXPECT_TRUE(pm->IsUpdateScheduled()); Could inserting some EXPECT_FALSE(pm->IsUpdateScheduled()); in strategic places also ...
8 years ago (2012-12-06 00:51:40 UTC) #7
cbentzel
Sorry for the slow response. Merged the CL against the previous one which removed the ...
8 years ago (2012-12-17 11:24:10 UTC) #8
cbentzel
On 2012/12/17 11:24:10, cbentzel wrote: > Sorry for the slow response. Merged the CL against ...
8 years ago (2012-12-17 22:13:14 UTC) #9
cbentzel
Fixed the merge. Please re-review. Thanks.
8 years ago (2012-12-18 14:05:10 UTC) #10
mattm
lgtm https://codereview.chromium.org/11419041/diff/32001/chrome/browser/safe_browsing/database_manager.cc File chrome/browser/safe_browsing/database_manager.cc (right): https://codereview.chromium.org/11419041/diff/32001/chrome/browser/safe_browsing/database_manager.cc#newcode608 chrome/browser/safe_browsing/database_manager.cc:608: if (enabled_) Just for weakptr safety, these callback.Run() ...
8 years ago (2012-12-19 03:58:48 UTC) #11
cbentzel
https://codereview.chromium.org/11419041/diff/32001/chrome/browser/safe_browsing/database_manager.cc File chrome/browser/safe_browsing/database_manager.cc (right): https://codereview.chromium.org/11419041/diff/32001/chrome/browser/safe_browsing/database_manager.cc#newcode608 chrome/browser/safe_browsing/database_manager.cc:608: if (enabled_) On 2012/12/19 03:58:48, mattm wrote: > Just ...
8 years ago (2012-12-19 13:18:33 UTC) #12
mattm
On 2012/12/19 13:18:33, cbentzel wrote: > https://codereview.chromium.org/11419041/diff/32001/chrome/browser/safe_browsing/database_manager.cc > File chrome/browser/safe_browsing/database_manager.cc (right): > > https://codereview.chromium.org/11419041/diff/32001/chrome/browser/safe_browsing/database_manager.cc#newcode608 > ...
8 years ago (2012-12-19 18:57:40 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cbentzel@chromium.org/11419041/42002
8 years ago (2012-12-20 11:58:46 UTC) #14
commit-bot: I haz the power
Failed to apply patch for chrome/browser/safe_browsing/protocol_manager_unittest.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
8 years ago (2012-12-20 11:58:48 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cbentzel@chromium.org/11419041/46004
8 years ago (2012-12-20 19:39:19 UTC) #16
commit-bot: I haz the power
8 years ago (2012-12-20 23:16:52 UTC) #17
Message was sent while issue was closed.
Change committed as 174269

Powered by Google App Engine
This is Rietveld 408576698