|
|
Created:
3 years, 10 months ago by xunjieli Modified:
3 years, 10 months ago Reviewers:
Zhongyi Shi CC:
chromium-reviews, cbentzel+watch_chromium.org, net-reviews_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionHttpServerPropertiesManager and tests cleanup
This CL cleans up HttpServerPropertiesManager and its unittests:
HttpServerPropertiesManager:
1. Cleanup test-only virtual methods in cc and h files.
Tests:
1. Re-enable unintentional commented out test code
2. Remove unused fields and methods in test file
3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test
because that test is really testing cache -> pref update.
4. Simplify two unit tests: UpdatePrefsWithCache and
DoNotPersistExpiredOrBrokenAlternativeService.
Review-Url: https://codereview.chromium.org/2681383002
Cr-Commit-Position: refs/heads/master@{#449713}
Committed: https://chromium.googlesource.com/chromium/src/+/2b355b10cfd06d3a0e4b5fc563a3c9ee2f4e4d79
Patch Set 1 #Patch Set 2 : self #Patch Set 3 : self #Patch Set 4 : simplify tests #
Total comments: 4
Messages
Total messages: 30 (24 generated)
Interestingly, we have some commented out code in the test file. I think it is unintentional. This is to uncomment the code.
The CQ bit was checked by xunjieli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Uncommented out test code in http_server_properties_manager_unittest.cc R=zhongyi@chromium.org ========== to ========== HttpServerPropertiesManager tests cleanup This CL cleans up the unittest: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Cleanup test only methods in cc and h files. R=zhongyi@chromium.org ==========
The CQ bit was checked by xunjieli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #2 (id:20001) has been deleted
The CQ bit was checked by xunjieli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by xunjieli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== HttpServerPropertiesManager tests cleanup This CL cleans up the unittest: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Cleanup test only methods in cc and h files. R=zhongyi@chromium.org ========== to ========== HttpServerPropertiesManager tests cleanup This CL cleans up the unittest: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Cleanup test only methods in cc and h files. 4. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 5. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. R=zhongyi@chromium.org ==========
Description was changed from ========== HttpServerPropertiesManager tests cleanup This CL cleans up the unittest: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Cleanup test only methods in cc and h files. 4. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 5. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. R=zhongyi@chromium.org ========== to ========== HttpServerPropertiesManager and tests cleanup This CL cleans up HttpServerPropertiesManager and its unittests: HttpServerPropertiesManager: 1. Cleanup test only methods in cc and h files. tests: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 5. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. R=zhongyi@chromium.org ==========
Description was changed from ========== HttpServerPropertiesManager and tests cleanup This CL cleans up HttpServerPropertiesManager and its unittests: HttpServerPropertiesManager: 1. Cleanup test only methods in cc and h files. tests: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 5. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. R=zhongyi@chromium.org ========== to ========== HttpServerPropertiesManager and tests cleanup This CL cleans up HttpServerPropertiesManager and its unittests: HttpServerPropertiesManager: 1. Cleanup test only methods in cc and h files. tests: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 4. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. ==========
Description was changed from ========== HttpServerPropertiesManager and tests cleanup This CL cleans up HttpServerPropertiesManager and its unittests: HttpServerPropertiesManager: 1. Cleanup test only methods in cc and h files. tests: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 4. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. ========== to ========== HttpServerPropertiesManager and tests cleanup This CL cleans up HttpServerPropertiesManager and its unittests: HttpServerPropertiesManager: 1. Cleanup test only methods in cc and h files. Tests: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 4. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. ==========
Description was changed from ========== HttpServerPropertiesManager and tests cleanup This CL cleans up HttpServerPropertiesManager and its unittests: HttpServerPropertiesManager: 1. Cleanup test only methods in cc and h files. Tests: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 4. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. ========== to ========== HttpServerPropertiesManager and tests cleanup This CL cleans up HttpServerPropertiesManager and its unittests: HttpServerPropertiesManager: 1. Cleanup test-only virtual methods in cc and h files. Tests: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 4. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Thanks for cleaning this up, looks good to me, just one question about the test. https://codereview.chromium.org/2681383002/diff/80001/net/http/http_server_pr... File net/http/http_server_properties_manager_unittest.cc (left): https://codereview.chromium.org/2681383002/diff/80001/net/http/http_server_pr... net/http/http_server_properties_manager_unittest.cc:1178: Hm, I thought we had UpdateCacheWithPref and UpdatePrefsWithCache in the tests before your change. The other way to make this test indeed a UpdateCacheWithPrefs would be instead of call ScheduleUpdateCacheOnPrefThread directly, call OnHttpServerPropertiesChanged. Does that make sense? Your fix looks good to me, maybe we should add one more test. How do you think? https://cs.chromium.org/chromium/src/net/http/http_server_properties_manager.... https://codereview.chromium.org/2681383002/diff/80001/net/http/http_server_pr... File net/http/http_server_properties_manager_unittest.cc (right): https://codereview.chromium.org/2681383002/diff/80001/net/http/http_server_pr... net/http/http_server_properties_manager_unittest.cc:659: const int64_t kUpdatePrefsDelayMs = 60000; Just to confirm, looks like all the tests are now running with the default delay as .cc file when update pref/cache, right? Here we need to declare a local kUpdatePrefsDelayMs as we want to control the timer and verify the behavior of ther net thread. In those tests we don't need verify, we just fast forward until no task remain.
https://codereview.chromium.org/2681383002/diff/80001/net/http/http_server_pr... File net/http/http_server_properties_manager_unittest.cc (left): https://codereview.chromium.org/2681383002/diff/80001/net/http/http_server_pr... net/http/http_server_properties_manager_unittest.cc:1178: On 2017/02/10 18:01:38, Zhongyi Shi wrote: > Hm, I thought we had UpdateCacheWithPref and UpdatePrefsWithCache in the tests > before your change. > > The other way to make this test indeed a UpdateCacheWithPrefs would be instead > of call ScheduleUpdateCacheOnPrefThread directly, call > OnHttpServerPropertiesChanged. Does that make sense? Your fix looks good to me, > maybe we should add one more test. How do you think? > > https://cs.chromium.org/chromium/src/net/http/http_server_properties_manager.... Talked to Cherie offline. There are other 4 tests that test the other direction: BadSupportsQuic, SingleUpdateForTwoSpdyServerPrefChanges, BadCachedHostPortPair, BadCachedAltProtocolPort https://codereview.chromium.org/2681383002/diff/80001/net/http/http_server_pr... File net/http/http_server_properties_manager_unittest.cc (right): https://codereview.chromium.org/2681383002/diff/80001/net/http/http_server_pr... net/http/http_server_properties_manager_unittest.cc:659: const int64_t kUpdatePrefsDelayMs = 60000; On 2017/02/10 18:01:38, Zhongyi Shi wrote: > Just to confirm, looks like all the tests are now running with the default delay > as .cc file when update pref/cache, right? > Yes. > Here we need to declare a local kUpdatePrefsDelayMs as we want to control the > timer and verify the behavior of ther net thread. In those tests we don't need > verify, we just fast forward until no task remain. Yes, that's my understanding too.
lgtm! Thanks for improving those tests!
The CQ bit was checked by xunjieli@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 80001, "attempt_start_ts": 1486757064842590, "parent_rev": "b36013be8cd2518e4b41e43ace3f6007c48ea078", "commit_rev": "2b355b10cfd06d3a0e4b5fc563a3c9ee2f4e4d79"}
Message was sent while issue was closed.
Description was changed from ========== HttpServerPropertiesManager and tests cleanup This CL cleans up HttpServerPropertiesManager and its unittests: HttpServerPropertiesManager: 1. Cleanup test-only virtual methods in cc and h files. Tests: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 4. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. ========== to ========== HttpServerPropertiesManager and tests cleanup This CL cleans up HttpServerPropertiesManager and its unittests: HttpServerPropertiesManager: 1. Cleanup test-only virtual methods in cc and h files. Tests: 1. Re-enable unintentional commented out test code 2. Remove unused fields and methods in test file 3. Rename UpdateCacheWithPrefs test to UpdatePrefsWithCache test because that test is really testing cache -> pref update. 4. Simplify two unit tests: UpdatePrefsWithCache and DoNotPersistExpiredOrBrokenAlternativeService. Review-Url: https://codereview.chromium.org/2681383002 Cr-Commit-Position: refs/heads/master@{#449713} Committed: https://chromium.googlesource.com/chromium/src/+/2b355b10cfd06d3a0e4b5fc563a3... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:80001) as https://chromium.googlesource.com/chromium/src/+/2b355b10cfd06d3a0e4b5fc563a3... |