Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(1)

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 months, 1 week ago by pmarko
Modified:
2 months, 1 week 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. #

Messages

Total messages: 12 (5 generated)
pmarko
Julian, PTAL.
2 months, 1 week 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 ...
2 months, 1 week 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 ...
2 months, 1 week 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 ...
2 months, 1 week 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 ...
2 months, 1 week 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
2 months, 1 week ago (2017-05-19 11:49:51 UTC) #9
commit-bot: I haz the power
2 months, 1 week 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...
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 25c286973