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

Issue 2893803005: Fail tests fast if Windows registry key override fails (Closed)

Created:
3 years, 7 months ago by pmarko
Modified:
3 years, 7 months ago
Reviewers:
pastarmovj
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fail tests fast if Windows registry key override fails policy_loader_win_unittest uses RegOverridePredefKey to remap registry keys to a temporary key for the duration of the test. If this remapping fails, the test should fail fast to avoid accidentally creating persistent changes in the machine's registry. This is done by moving the remap step into the test's SetUp() method. gtest documentation says that the test will not continue if an ASSERT fails in SetUp()[1][2]. Also, we now delete the temporary registry keys if they already exist. These are keyed by the process id, so a subsequent test could reuse an existing temporary key if the previous test (with the same process id) crashed and failed to clean up. [1] https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#invoking-the-tests [2] https://cs.chromium.org/chromium/src/third_party/mesa/src/src/gtest/src/gtest.cc?rcl=ef811c6bd4de74e13e7035ca882cc77f85793fef&l=2159 BUG=721691 Review-Url: https://codereview.chromium.org/2893803005 Cr-Commit-Position: refs/heads/master@{#473174} Committed: https://chromium.googlesource.com/chromium/src/+/1059e59ba99809a03a245e7f55a98efba63567d6

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -17 lines) Patch
M components/policy/core/common/configuration_policy_provider_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/policy/core/common/policy_loader_win_unittest.cc View 1 6 chunks +45 lines, -16 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
pmarko
Julian, PTAL.
3 years, 7 months ago (2017-05-19 10:56:47 UTC) #3
pastarmovj
https://codereview.chromium.org/2893803005/diff/1/components/policy/core/common/policy_loader_win_unittest.cc File components/policy/core/common/policy_loader_win_unittest.cc (right): https://codereview.chromium.org/2893803005/diff/1/components/policy/core/common/policy_loader_win_unittest.cc#newcode302 components/policy/core/common/policy_loader_win_unittest.cc:302: ScopedGroupPolicyRegistrySandbox::ScopedGroupPolicyRegistrySandbox() { move constructor code over and auto result1 ...
3 years, 7 months ago (2017-05-19 11:14:17 UTC) #4
pmarko
Thank you, PTAL! https://codereview.chromium.org/2893803005/diff/1/components/policy/core/common/policy_loader_win_unittest.cc File components/policy/core/common/policy_loader_win_unittest.cc (right): https://codereview.chromium.org/2893803005/diff/1/components/policy/core/common/policy_loader_win_unittest.cc#newcode302 components/policy/core/common/policy_loader_win_unittest.cc:302: ScopedGroupPolicyRegistrySandbox::ScopedGroupPolicyRegistrySandbox() { On 2017/05/19 11:14:17, pastarmovj ...
3 years, 7 months ago (2017-05-19 11:27:27 UTC) #5
pastarmovj
lgtm ps. I built and ran the tests and they pass and does not leave ...
3 years, 7 months ago (2017-05-19 11:48:33 UTC) #6
pmarko
On 2017/05/19 11:48:33, pastarmovj wrote: > lgtm > > ps. I built and ran the ...
3 years, 7 months ago (2017-05-19 11:49:31 UTC) #7
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/2893803005/20001
3 years, 7 months ago (2017-05-19 11:49:51 UTC) #9
commit-bot: I haz the power
3 years, 7 months ago (2017-05-19 13:23:19 UTC) #12
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/1059e59ba99809a03a245e7f55a9...

Powered by Google App Engine
This is Rietveld 408576698