• Maksim Ivanov's avatar
    Fix KeyRotationDeviceCloudPolicyTest.Basic · e44132fd
    Maksim Ivanov authored
    Fix a few errors in the KeyRotationDeviceCloudPolicyTest.Basic browser
    test - some of them were presumably causing the flakiness that led to
    the test being disabled, some of them were accidentally added during
    later refactorings:
    
    1. Correctly pipe through LocalPolicyTestServerMixin the needed settings
       of policy_testserver: the usage of signing keys bundled into the
       Python server and the automatic rotation of the signing key with
       every policy request.
    2. Fix misplaced calls in the test's SetUp() phase: everything needs to
       be done *before* calling the parent SetUp() in order to run before
       the test.
    3. Make the test less fragile by doing two explicit fetches of policy
       inside the test body and checking that the key got rotated in
       between (instead of relying on the device policy stack making the
       first policy fetch during its initialization and on the right parity
       of the PolicyBuilder's policy key version).
    
    Bug: 900631
    Test: run the test 10'000 times (browser_tests --gtest_filter="KeyRotationDeviceCloudPolicyTest.Basic")
    Change-Id: I5eaa4f6e03a54dcc26319d39323f5edf51904c65
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829383
    Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
    Reviewed-by: default avatarDenis Kuznetsov <antrim@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#702976}
    e44132fd
device_cloud_policy_browsertest.cc 17.6 KB