• dpapad's avatar
    PDF Viewer: Return a Promise from getViewportFromUrlParams(). · bb9c12a3
    dpapad authored
    The API was previously callback-based, instead of Promise-based.
    Callback-based APIs are more tedious to use. As a concrete example,
    the PDFExtensionJSTest.ParamsParser tests were incorrectly not waiting
    for any of the callbacks to execute before declaring the test
    successful.
    
    In the process also
     - Changed Navigator#navigate() to return a Promise, instead of
       firing a 'navigate-for-testing' event.
     - Fixed incorrect type annotation for OpenPdfParams#viewPosition.
    
    Bug: None
    Change-Id: Ib14b6499d3c661bb62c21c1836324ceecf1494ea
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2618219
    Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
    Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
    Auto-Submit: dpapad <dpapad@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#842168}
    bb9c12a3
open_pdf_params_parser.js 8.39 KB