• David Van Cleve's avatar
    Trust Tokens: Add TestRunner support for state reset and key commitments · 33c40e08
    David Van Cleve authored
    The prototype Trust Token API (https://github.com/wicg/trust-token-api)
    provides new JS functionality with which one can specify certain
    cryptographic operations to execute along outgoing requests. These
    operations can affect persistent state stored in the network service, so
    tests exercising them would be non-hermetic absent additional
    functionality to reset the state. Additionally, the operations rely on
    the presence of "key commitments" (collections of cryptographic keys and
    associated metadata) obtained through the component updater in standard
    operation; tests need a way to set these keys without relying on the
    updater.
    
    This CL adds testRunner bindings to
    
    1. reset persistent Trust Tokens state and
    2. manually set Trust Tokens key commitments
    
    so that it's possible to write end-to-end Blink layout tests for the new
    Trust Tokens functionality.
    
    Eventually, the same functionality will likely become available through
    WPT testdriver, and the Trust Tokens tests will be able to migrate to
    WPT: since it's slightly more involved to implement equivalent
    functionality via testdriver, this is a first pass allowing writing
    end-to-end HTML/JS tests before the equivalent WPT automation exists.
    
    Test: Migrate a WPT to use the state reset binding.
    Fixed: 1061764
    Change-Id: I0d8b9458f89e1ba4c641f27a189480028957094d
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2139444
    Commit-Queue: David Van Cleve <davidvc@chromium.org>
    Reviewed-by: default avatarMatthew Denton <mpdenton@chromium.org>
    Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#759493}
    33c40e08
test_runner.cc 90.4 KB