• Colin Blundell's avatar
    [WebLayer] Add test of behavior when hitting SSL errors · 030a2631
    Colin Blundell authored
    This CL adds a browsertest that a navigation to a URL of type HTTPS
    succeeds by default and fails if the site has a mismatched certificate.
    We're adding this test now in anticipation of implementing SSL
    interstitials, at which point we'll expand the test to test the
    interstitial behavior.
    
    This CL also adds necessary infrastructure to enable navigations to URLs
    supplied by embedded test servers of type HTTPS:
    
    - A ContentUtilityClient implementation whose registration of network
      binders can be overridden.
    - An installation of
      content::NetworkServiceTestHelper::RegisterNetworkBinders() for
      weblayer browsertests.
    
    Note that I first tried a simpler mechanism for the above: Invoking
    the relevant parts of the body of
    content::NetworkServiceTestHelper::RegisterNetworkBinders() directly
    from browsertests_main.cc:main() when in utility processes. However,
    this appears to be too early to invoke these functions, as it resulted
    in the following:
    
    [223377:223377:1015/171544.292381:ERROR:sandbox_linux.cc(367)] InitializeSandbox() called with multiple threads in process utility. Try waiting for /proc to be updated.
    [223377:223377:1015/171544.327809:FATAL:thread_helpers.cc(104)] Current process is not mono-threaded! (iterations: 25)
    
    0 0x7ff318df263f base::debug::CollectStackTrace()
    1 0x7ff318b217ed base::debug::StackTrace::StackTrace()
    2 0x7ff318b217a8 base::debug::StackTrace::StackTrace()
    3 0x7ff318b73559 logging::LogMessage::~LogMessage()
    4 0x7ff2f3401232 sandbox::(anonymous namespace)::RunWhileTrue()
    5 0x7ff2f3400f71 sandbox::ThreadHelpers::AssertSingleThreaded()
    6 0x7ff2f34012d1 sandbox::ThreadHelpers::AssertSingleThreaded()
    7 0x7ff3067300e4 service_manager::SandboxLinux::InitializeSandbox()
    8 0x7ff30672929b service_manager::Sandbox::Initialize()
    9 0x7ff313276abf content::UtilityMain()
    
    Change-Id: I1c89b7b77b028aca06c28d0b83ab1a7dbcf9f117
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859993
    Commit-Queue: Colin Blundell <blundell@chromium.org>
    Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#707350}
    030a2631
weblayer_browser_test_utils.h 661 Bytes