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

Issue 2700233002: Update SRTFetcher browser test to use ScopedMockTimeMessageLoopTaskRunner (Closed)

Created:
3 years, 10 months ago by Joe Mason
Modified:
3 years, 9 months ago
CC:
chromium-reviews, joenotcharles+watch_chromium.org, grt+watch_chromium.org, pennymac+watch_chromium.org, wfh+watch_chromium.org, ftirelo+watch_chromium.org, alito+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Update SRTFetcher browser test to use TestMockTimeTaskRunner. This allows us to simplify the interface by eliminating main_thread_task_runner and moving blocking_task_runner to SwReporterTestingDelegate with the rest of the test overrides. The browser test now knows much less about the internal implementation of ReporterRunner, too. BUG=641081 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win10_chromium_x64_rel_ng Review-Url: https://codereview.chromium.org/2700233002 Cr-Commit-Position: refs/heads/master@{#452917} Committed: https://chromium.googlesource.com/chromium/src/+/171b102f8145fffe0cb58f72d8f78e20598f3ba1

Patch Set 1 #

Patch Set 2 : Much cleanup #

Patch Set 3 : Add comments #

Total comments: 13

Patch Set 4 : Rebase #

Patch Set 5 : Address gab's comments #

Total comments: 33

Patch Set 6 : Address grt's comments #

Total comments: 4

Patch Set 7 : ClearPendingTasks is not needed #

Total comments: 2

Patch Set 8 : Fix includes, stop using ASSERT in helper function #

Total comments: 12

Patch Set 9 : Fix nits #

Patch Set 10 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+329 lines, -402 lines) Patch
M chrome/browser/component_updater/sw_reporter_installer_win.cc View 1 2 chunks +1 line, -12 lines 0 comments Download
M chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc View 1 2 3 4 5 6 7 8 9 10 chunks +285 lines, -341 lines 0 comments Download
M chrome/browser/safe_browsing/srt_fetcher_win.h View 1 2 3 chunks +8 lines, -13 lines 0 comments Download
M chrome/browser/safe_browsing/srt_fetcher_win.cc View 1 2 3 4 5 6 7 8 9 13 chunks +35 lines, -36 lines 0 comments Download

Messages

Total messages: 34 (13 generated)
Joe Mason
ptal
3 years, 10 months ago (2017-02-21 20:59:51 UTC) #4
Joe Mason
+gab for use of the mock clock
3 years, 10 months ago (2017-02-21 21:16:27 UTC) #6
gab
Yay for having a single task runner on main thread with a mock clock :). ...
3 years, 10 months ago (2017-02-21 22:15:37 UTC) #7
Joe Mason
https://codereview.chromium.org/2700233002/diff/40001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc File chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc (right): https://codereview.chromium.org/2700233002/diff/40001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc#newcode49 chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc:49: std::make_unique<base::ScopedMockTimeMessageLoopTaskRunner>(); On 2017/02/21 22:15:36, gab wrote: > std::make_unique is ...
3 years, 10 months ago (2017-02-22 04:43:37 UTC) #8
grt (UTC plus 2)
looks like a nice improvement. comments below. https://codereview.chromium.org/2700233002/diff/80001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc File chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc (right): https://codereview.chromium.org/2700233002/diff/80001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc#newcode55 chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc:55: (*scoped_task_runner_) "(*scoped_task_runner_)->" ...
3 years, 10 months ago (2017-02-22 12:25:26 UTC) #9
gab
A few comments on comments. As discussed offline I think it might be nice to ...
3 years, 10 months ago (2017-02-22 17:19:49 UTC) #10
Joe Mason
https://codereview.chromium.org/2700233002/diff/80001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc File chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc (right): https://codereview.chromium.org/2700233002/diff/80001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc#newcode55 chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc:55: (*scoped_task_runner_) On 2017/02/22 12:25:26, grt (UTC plus 1) wrote: ...
3 years, 10 months ago (2017-02-22 17:56:46 UTC) #11
Joe Mason
On 2017/02/22 17:19:49, gab wrote: > > The problem is this line here: > > ...
3 years, 10 months ago (2017-02-22 18:02:56 UTC) #12
gab
https://codereview.chromium.org/2700233002/diff/100001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc File chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc (right): https://codereview.chromium.org/2700233002/diff/100001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc#newcode67 chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc:67: // SRTFetcher always leaves another SRT launch task pending. ...
3 years, 10 months ago (2017-02-22 18:29:25 UTC) #13
Joe Mason
https://codereview.chromium.org/2700233002/diff/100001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc File chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc (right): https://codereview.chromium.org/2700233002/diff/100001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc#newcode67 chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc:67: // SRTFetcher always leaves another SRT launch task pending. ...
3 years, 10 months ago (2017-02-22 19:22:09 UTC) #14
grt (UTC plus 2)
lgtm with a fix to the use of ASSERT and the addition of <initializer_list>. https://codereview.chromium.org/2700233002/diff/80001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc ...
3 years, 10 months ago (2017-02-23 13:13:26 UTC) #16
Joe Mason
+sorin for OWNERS review of sw_reporter_install_win.cc +jialiua for OWNERS review of safe_browsing/* https://codereview.chromium.org/2700233002/diff/80001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc File chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc ...
3 years, 10 months ago (2017-02-23 15:49:29 UTC) #18
Jialiu Lin
lgtm for c/b/safe_browsing/* https://codereview.chromium.org/2700233002/diff/140001/chrome/browser/safe_browsing/srt_fetcher_win.cc File chrome/browser/safe_browsing/srt_fetcher_win.cc (right): https://codereview.chromium.org/2700233002/diff/140001/chrome/browser/safe_browsing/srt_fetcher_win.cc#newcode1004 chrome/browser/safe_browsing/srt_fetcher_win.cc:1004: base::CreateTaskRunnerWithTraits( nit: maybe put this initialization ...
3 years, 10 months ago (2017-02-23 18:28:00 UTC) #19
gab
Use of mock time lgtm, didn't look at everything else closely but looks like a ...
3 years, 10 months ago (2017-02-23 19:01:52 UTC) #20
gab
https://codereview.chromium.org/2700233002/diff/140001/chrome/browser/safe_browsing/srt_fetcher_win.cc File chrome/browser/safe_browsing/srt_fetcher_win.cc (right): https://codereview.chromium.org/2700233002/diff/140001/chrome/browser/safe_browsing/srt_fetcher_win.cc#newcode1004 chrome/browser/safe_browsing/srt_fetcher_win.cc:1004: base::CreateTaskRunnerWithTraits( On 2017/02/23 19:01:51, gab wrote: > On 2017/02/23 ...
3 years, 10 months ago (2017-02-23 19:02:25 UTC) #21
Sorin Jianu
lgtm thank you! component updater lgtm https://codereview.chromium.org/2700233002/diff/140001/chrome/browser/safe_browsing/srt_fetcher_win.cc File chrome/browser/safe_browsing/srt_fetcher_win.cc (right): https://codereview.chromium.org/2700233002/diff/140001/chrome/browser/safe_browsing/srt_fetcher_win.cc#newcode721 chrome/browser/safe_browsing/srt_fetcher_win.cc:721: return g_testing_delegate_->Now(); could ...
3 years, 10 months ago (2017-02-23 20:39:05 UTC) #22
Joe Mason
https://codereview.chromium.org/2700233002/diff/140001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc File chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc (right): https://codereview.chromium.org/2700233002/diff/140001/chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc#newcode54 chrome/browser/safe_browsing/srt_fetcher_browsertest_win.cc:54: DCHECK(saved_task_runner_ != mock_time_task_runner_); On 2017/02/23 19:01:51, gab wrote: > ...
3 years, 9 months ago (2017-02-24 17:35:29 UTC) #23
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/2700233002/160001
3 years, 9 months ago (2017-02-24 17:37:08 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/355670)
3 years, 9 months ago (2017-02-24 18:10:06 UTC) #28
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/2700233002/180001
3 years, 9 months ago (2017-02-24 19:22:59 UTC) #31
commit-bot: I haz the power
3 years, 9 months ago (2017-02-24 21:14:01 UTC) #34
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/171b102f8145fffe0cb58f72d8f7...

Powered by Google App Engine
This is Rietveld 408576698