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

Issue 2487343005: Fix Thread::SetMessageLoop(nullptr). (Closed)

Created:
4 years, 1 month ago by gab
Modified:
4 years ago
Reviewers:
danakj, mattm
CC:
chromium-reviews, grt+watch_chromium.org, grt (UTC plus 2), cbentzel
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix Thread::SetMessageLoop(nullptr). Unit tests that pass base::MessageLoop::current() to a Thread need to explicitly have a base::MessageLoop member as well or current() is null. A better alternative though is to just have a content::TestBrowserThreadBundle member. This long-standing issue (629139) was now blocking https://codereview.chromium.org/2464233002 which needs to unconditionally inspect the MessageLoop's member and it being unexpectedly null is a problem. Fixing the safe_browsing tests was a bit tricky because the TestSimpleTaskRunner they relied on doesn't honor delays. Mocking the MessageLoop's TaskRunner with a TestMockTimeTaskRunner was required. This in turn enabled better tests (that can explicitly wait for the expected timer to fire). Ideally, their Timers would use the same MockTickClock but FastForwardUntilNoTasksRemain() being the logical equivalent of the existing TestSimpleTaskRunner::RunUntilIdle() it was used instead where required to simplify this CL. BUG=629139, 653916 TBR=danakj (re-enabling DCHECK in thread.cc) Committed: https://crrev.com/ca6c3690e7a1daaa6b428958dbf247c6611bb7a3 Cr-Commit-Position: refs/heads/master@{#434114}

Patch Set 1 #

Patch Set 2 : Uploading ExpireTimersForTesting() requirement #

Patch Set 3 : Fix SafeBrowsing unit tests #

Total comments: 1

Patch Set 4 : Merge up to r434093 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -114 lines) Patch
M base/threading/thread.cc View 1 chunk +1 line, -6 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc View 1 2 49 chunks +57 lines, -55 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_manager.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/protocol_manager.cc View 1 2 3 5 chunks +19 lines, -13 lines 0 comments Download
M chrome/browser/safe_browsing/protocol_manager_unittest.cc View 1 2 3 23 chunks +48 lines, -39 lines 0 comments Download

Messages

Total messages: 34 (23 generated)
gab
Matt PTAL at chrome/browser/safe_browsing/* changes. @Dana, TBR for re-introducing DCHECK in thread.cc and getting one ...
4 years ago (2016-11-22 19:54:54 UTC) #11
mattm
lgtm
4 years ago (2016-11-22 23:50:27 UTC) #15
gab
On 2016/11/22 23:50:27, mattm wrote: > lgtm Thanks, TBR Dana for re-enabling DCHECK in thread.cc
4 years ago (2016-11-22 23:56:15 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2487343005/60001
4 years ago (2016-11-22 23:57:06 UTC) #19
commit-bot: I haz the power
Failed to apply patch for chrome/browser/safe_browsing/protocol_manager_unittest.cc: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-11-23 00:46:48 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2487343005/60001
4 years ago (2016-11-23 02:13:56 UTC) #23
commit-bot: I haz the power
Failed to apply patch for chrome/browser/safe_browsing/protocol_manager_unittest.cc: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-11-23 02:23:19 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2487343005/80001
4 years ago (2016-11-23 03:06:56 UTC) #28
commit-bot: I haz the power
Committed patchset #4 (id:80001)
4 years ago (2016-11-23 04:25:57 UTC) #31
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/ca6c3690e7a1daaa6b428958dbf247c6611bb7a3 Cr-Commit-Position: refs/heads/master@{#434114}
4 years ago (2016-11-23 04:27:49 UTC) #33
danakj
4 years ago (2016-11-29 01:51:06 UTC) #34
Message was sent while issue was closed.
LGTM

Powered by Google App Engine
This is Rietveld 408576698