• Tim Volodine's avatar
    [AW NS] provide proper user_agent in onDownloadStart callback and add tests · 079c096d
    Tim Volodine authored
    The user agent is not necessarily set in the request headers
    during InterceptDownload (e.g. because they are not initialized yet).
    
    In this patch:
    - make sure a user agent is set in the case of uninitialized headers.
    - make sure the user agent override is used when it is set by using
    WebSetting.setUserAgentString().
    - add download related instrumentation tests for the user agent
    setting.
    
    Tests:
    - AwContentsTest.testDownload
    - AwContentsTest.testDownloaWithCustomUserAgent
    
    BUG=893568,841556
    
    Cq-Include-Trybots: master.tryserver.chromium.android:android_mojo
    Change-Id: Ifc432fd93dd68ffb7416a25b6d6d1b5d1021e327
    Reviewed-on: https://chromium-review.googlesource.com/c/1477606
    Commit-Queue: Tim Volodine <timvolodine@chromium.org>
    Reviewed-by: default avatarRichard Coles <torne@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#634890}
    079c096d
aw_download_manager_delegate.cc 3.39 KB