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

Issue 2010463002: Mocker for OSCrypt (Closed)

Created:
4 years, 7 months ago by cfroussios
Modified:
4 years, 6 months ago
CC:
bondd+autofillwatch_chromium.org, browser-components-watch_chromium.org, chromium-reviews, estade+watch_chromium.org, jdonnelly+autofillwatch_chromium.org, markusheintz_, msramek+watch_chromium.org, rouslan+autofill_chromium.org, sync-reviews_chromium.org, vabr+watchlistautofill_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

OSCryptMocker OSCrypt uses OS-level password storage services (e.g. Keychain). Tests should avoid involving such services. Currently, tests do that with OS-specific code. Soon, linux will need such mocking too. This CL introduces the build target //components/os_crypt:test_support, which contains an abstraction for mocking: OSCryptMocker. This abstraction replaces previous OS-specific mocking instructions in tests. Additionally, I added it to some tests which previously omitted mocking entirely. BUG=602624 Committed: https://crrev.com/d281ff9e63f782362ef6ea0ccdde6c1238f34431 Cr-Commit-Position: refs/heads/master@{#396472}

Patch Set 1 #

Patch Set 2 : Fix all the builds #

Patch Set 3 : Fix windows too #

Patch Set 4 : Updated more tests #

Patch Set 5 : #

Total comments: 14

Patch Set 6 : Repair InProcessBrowserTest #

Patch Set 7 : Recommendations + more tests #

Patch Set 8 : Fix #

Patch Set 9 : more fix #

Patch Set 10 : Removed unnecessary build condition #

Total comments: 4

Patch Set 11 : Updated doc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -73 lines) Patch
M chrome/browser/autofill/autofill_browsertest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/autofill/autofill_interactive_uitest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_remover_unittest.cc View 1 2 3 4 5 6 7 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/password_manager/password_generation_interactive_uitest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/password_manager/password_manager_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/password_manager/password_store_mac_unittest.cc View 1 2 3 5 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/password_manager/password_store_proxy_mac_unittest.cc View 1 2 3 4 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/password_manager/simple_password_store_mac_unittest.cc View 1 2 3 4 5 6 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/signin/local_auth_unittest.cc View 1 2 3 4 5 6 4 chunks +7 lines, -9 lines 0 comments Download
M chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc View 4 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_test.cc View 1 2 3 4 5 6 4 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/bidi_checker_web_ui_test.cc View 1 2 3 4 5 6 7 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/test/base/in_process_browser_test.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +6 lines, -7 lines 0 comments Download
M components/autofill/core/browser/BUILD.gn View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M components/autofill/core/browser/autofill_merge_unittest.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -1 line 0 comments Download
M components/autofill/core/browser/autofill_metrics_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/autofill/core/browser/autofill_test_utils.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M components/autofill/core/browser/autofill_test_utils.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -4 lines 0 comments Download
M components/autofill/core/browser/personal_data_manager_unittest.cc View 1 2 3 4 5 6 4 chunks +7 lines, -0 lines 0 comments Download
M components/autofill/core/browser/webdata/autofill_table_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +7 lines, -4 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M components/os_crypt.gypi View 1 chunk +24 lines, -0 lines 0 comments Download
M components/os_crypt/BUILD.gn View 1 2 3 4 5 6 2 chunks +22 lines, -0 lines 0 comments Download
A components/os_crypt/os_crypt_mocker.h View 1 2 3 4 5 6 7 8 9 1 chunk +24 lines, -0 lines 0 comments Download
A components/os_crypt/os_crypt_mocker.cc View 1 chunk +21 lines, -0 lines 0 comments Download
M components/os_crypt/os_crypt_unittest.cc View 1 2 3 4 5 6 1 chunk +3 lines, -6 lines 0 comments Download
M components/password_manager/core/browser/BUILD.gn View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M components/password_manager/core/browser/login_database_unittest.cc View 1 2 3 4 5 6 chunks +10 lines, -12 lines 0 comments Download
M components/signin/core/browser/BUILD.gn View 1 1 chunk +1 line, -1 line 0 comments Download
M components/signin/core/browser/webdata/token_service_table_unittest.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M components/sync_driver/BUILD.gn View 1 1 chunk +1 line, -1 line 0 comments Download
M components/sync_driver/system_encryptor_unittest.cc View 1 2 chunks +3 lines, -4 lines 0 comments Download

Messages

Total messages: 41 (22 generated)
cfroussios
Hi vabr. Would you be kind enough to be the first to review the introduction ...
4 years, 7 months ago (2016-05-24 12:51:14 UTC) #5
vabr (Chromium)
Thank you, this LGTM! Please have a look at the comments below. In some places ...
4 years, 7 months ago (2016-05-24 13:33:44 UTC) #6
msramek
https://codereview.chromium.org/2010463002/diff/80001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc File chrome/browser/browsing_data/browsing_data_remover_unittest.cc (right): https://codereview.chromium.org/2010463002/diff/80001/chrome/browser/browsing_data/browsing_data_remover_unittest.cc#newcode1014 chrome/browser/browsing_data/browsing_data_remover_unittest.cc:1014: void SetUp() override { OSCryptMocker::SetUpWithSingleton(); } Drive by! Wouldn't ...
4 years, 7 months ago (2016-05-24 13:40:58 UTC) #8
cfroussios
Thanks for the feedback! @vabr I modified more files, some of which are captured by ...
4 years, 7 months ago (2016-05-25 13:13:09 UTC) #11
msramek
Thanks! browsing_data/ LGTM.
4 years, 7 months ago (2016-05-25 13:21:09 UTC) #14
cfroussios
thestig@chromium.org: This CL contains the skeleton for mocking oscrypt and applies it to affected tests. ...
4 years, 7 months ago (2016-05-25 13:37:16 UTC) #17
vabr (Chromium)
LGTM, thanks!
4 years, 7 months ago (2016-05-25 13:50:52 UTC) #18
cfroussios
maxbogue@chromium.org: Please review changes in components/sync_driver/BUILD.gn components/sync_driver/system_encryptor_unittests.cc Thanks!
4 years, 7 months ago (2016-05-25 13:52:31 UTC) #20
cfroussios
rogerta@chromium.org: Please review changes in components/signin/core/browser/BUILD.gn components/signin/core/browser/webdata/token_service_table_unittest.cc Thanks a lot!
4 years, 7 months ago (2016-05-25 13:59:30 UTC) #22
Roger Tawa OOO till Jul 10th
lgtm
4 years, 7 months ago (2016-05-25 15:06:32 UTC) #23
Lei Zhang
lgtm for os_crypt and chrome/ sans password_manager https://codereview.chromium.org/2010463002/diff/200001/chrome/test/base/in_process_browser_test.cc File chrome/test/base/in_process_browser_test.cc (right): https://codereview.chromium.org/2010463002/diff/200001/chrome/test/base/in_process_browser_test.cc#newcode224 chrome/test/base/in_process_browser_test.cc:224: // Always ...
4 years, 7 months ago (2016-05-25 21:11:41 UTC) #26
maxbogue
lgtm for components/sync_driver! Sorry it took me so long, I completely missed the email for ...
4 years, 6 months ago (2016-05-27 15:10:59 UTC) #27
cfroussios
@maxbogue No worries. Thanks! https://codereview.chromium.org/2010463002/diff/200001/chrome/test/base/in_process_browser_test.cc File chrome/test/base/in_process_browser_test.cc (right): https://codereview.chromium.org/2010463002/diff/200001/chrome/test/base/in_process_browser_test.cc#newcode224 chrome/test/base/in_process_browser_test.cc:224: // Always use the MockKeychain ...
4 years, 6 months ago (2016-05-27 15:28:22 UTC) #28
cfroussios
sdefresne@chromium.org: Please review changes in components/os_crypt.gypi Thanks!
4 years, 6 months ago (2016-05-27 15:29:06 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2010463002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2010463002/220001
4 years, 6 months ago (2016-05-27 15:32:38 UTC) #33
commit-bot: I haz the power
Committed patchset #11 (id:220001)
4 years, 6 months ago (2016-05-27 15:37:19 UTC) #35
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/d281ff9e63f782362ef6ea0ccdde6c1238f34431 Cr-Commit-Position: refs/heads/master@{#396472}
4 years, 6 months ago (2016-05-27 15:39:08 UTC) #37
cfroussios
@sdefresne Sorry I added you. I did not notice that the ownership of components/os_crypt.gypi was ...
4 years, 6 months ago (2016-05-27 15:40:51 UTC) #39
sdefresne
4 years, 6 months ago (2016-05-28 13:10:08 UTC) #41
Message was sent while issue was closed.
components/os_crypt.gypi lgtm

Powered by Google App Engine
This is Rietveld 408576698