• Lukasz Anforowicz's avatar
    Stop relying on disabled web security in CORB tests. · 143c15ec
    Lukasz Anforowicz authored
    This CL:
    
    1. Transitions core CORB test coverage away from the fetch API (where
       blocking by OOR-CORS can interfere with test results) to triggering
       fetches via <img> tags (where CORB stays applicable even after
       OOR-CORS ships).
    
       Tests covering CORS/CORB intersection continue to be done via fetch
       API (in CrossSiteDocumentBlockingTest.BlockFetches test).
    
       Verification of response body no longer depends on disabled web
       security (and inspecting fetch API results), but is instead done
       via RequestInterceptor helper that lives next to the tests.
       The CL also uncovered and fixes a threading issue in the
       implementation of RequestInterceptor.
    
    2. Stops testing range requests in content_browsertests and starts to
       rely on existing and new test coverage in content_unittests (fetch
       API seems to be the only directly-test-controllable way of making
       range requests).
    
    I've tested this CL by manually running CrossSiteDocumentBlockingTest
    from content_browsertests 1) in default mode, 2) with NetworkService
    enabled and 3) with NetworkService and OutOfBlinkCORS enabled.
    
    Bug: 870173
    Cq-Include-Trybots: luci.chromium.try:linux_mojo
    Change-Id: Iec5c9f0e7ddad0ff02627b88dcfab276795e7be9
    Reviewed-on: https://chromium-review.googlesource.com/c/1279351Reviewed-by: default avatarTakashi Toyoshima <toyoshim@chromium.org>
    Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
    Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
    Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#601174}
    143c15ec
cross_site_document_blocking_browsertest.cc 40.1 KB