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

Issue 2563273002: Change the net_task_runner to use a TestMockTimeTaskRunner in unittests so that (Closed)

Created:
4 years ago by Zhongyi Shi
Modified:
4 years ago
Reviewers:
Ryan Hamilton
CC:
chromium-reviews, cbentzel+watch_chromium.org, xunjieli
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change the HttpServerPropertiesManager::net_task_runner_ to use a TestMockTimeTaskRunner in unittests so that we are able to verify tasks posted with delay in the future. Now all the tests that were ExpectCacheUpdate or ExpectScheduleUpdatePrefsOnNetworkThread will need to call net_test_task_runner_>FastForwardUntilNoTasksRemain() so that all the tasks complete running. BUG=670519 Committed: https://crrev.com/65aa8f6576dce9b163c7c53fe5aecc9a1b44c00b Cr-Commit-Position: refs/heads/master@{#437980}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Move SetTaskRunner to HttpServerPropertiesManager #

Total comments: 8

Patch Set 3 : address rch's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -5 lines) Patch
M net/http/http_server_properties_manager.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_server_properties_manager_unittest.cc View 1 2 21 chunks +37 lines, -4 lines 0 comments Download

Messages

Total messages: 40 (29 generated)
Zhongyi Shi
4 years ago (2016-12-11 04:53:52 UTC) #10
Ryan Hamilton
Can you mention HttpServerProperties in the CL description (and title) so there's more context? https://codereview.chromium.org/2563273002/diff/20001/net/http/http_server_properties_manager_unittest.cc ...
4 years ago (2016-12-11 19:36:57 UTC) #13
Zhongyi Shi
https://codereview.chromium.org/2563273002/diff/20001/net/http/http_server_properties_manager_unittest.cc File net/http/http_server_properties_manager_unittest.cc (right): https://codereview.chromium.org/2563273002/diff/20001/net/http/http_server_properties_manager_unittest.cc#newcode378 net/http/http_server_properties_manager_unittest.cc:378: base::RunLoop().RunUntilIdle(); On 2016/12/11 19:36:57, Ryan Hamilton wrote: > base::RunLoop().RunUntilIdle(); ...
4 years ago (2016-12-12 04:38:54 UTC) #16
Zhongyi Shi
Updated: move the SetTaskRunner to HttpServerProperties. https://codereview.chromium.org/2563273002/diff/20001/net/http/http_server_properties_manager_unittest.cc File net/http/http_server_properties_manager_unittest.cc (right): https://codereview.chromium.org/2563273002/diff/20001/net/http/http_server_properties_manager_unittest.cc#newcode176 net/http/http_server_properties_manager_unittest.cc:176: http_server_props_manager_.get(), net_test_task_runner_); On ...
4 years ago (2016-12-12 05:08:39 UTC) #20
Ryan Hamilton
Just a couple nits. LGTM otherwise. https://codereview.chromium.org/2563273002/diff/40001/net/http/http_server_properties_manager.cc File net/http/http_server_properties_manager.cc (right): https://codereview.chromium.org/2563273002/diff/40001/net/http/http_server_properties_manager.cc#newcode103 net/http/http_server_properties_manager.cc:103: network_prefs_update_timer_->SetTaskRunner(std::move(network_task_runner_)); Do you ...
4 years ago (2016-12-12 05:30:20 UTC) #21
xunjieli
looks good! Deferring this CL to rch. Mocking out the task runner does seem cleaner ...
4 years ago (2016-12-12 18:47:41 UTC) #24
Zhongyi Shi
Thanks a lot for helping the review. Ryan, all the nits are addresses. I will ...
4 years ago (2016-12-12 21:14:46 UTC) #31
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/2563273002/80001
4 years ago (2016-12-12 22:37:10 UTC) #34
Ryan Hamilton
Looks great! LGTM
4 years ago (2016-12-12 22:45:05 UTC) #35
commit-bot: I haz the power
Committed patchset #3 (id:80001)
4 years ago (2016-12-13 01:42:24 UTC) #38
commit-bot: I haz the power
4 years ago (2016-12-13 01:45:26 UTC) #40
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/65aa8f6576dce9b163c7c53fe5aecc9a1b44c00b
Cr-Commit-Position: refs/heads/master@{#437980}

Powered by Google App Engine
This is Rietveld 408576698