• lukasza's avatar
    Split DumpPixelsAsync in pixel_dump.h into more granular functions. · 20971a65
    lukasza authored
    Before this CL, test_runner/pixel_dump.h would expose a single function:
    
      void DumpPixelsAsync(
          blink::WebView* web_view,
          const LayoutTestRuntimeFlags& layout_test_runtime_flags,
          float device_scale_factor_for_test,
          const base::Callback<void(const SkBitmap&)>& callback);
    
    After this CL, three more granular functions are exposed instead:
    
      void DumpPixelsAsync(blink::WebLocalFrame* web_frame,
                           float device_scale_factor_for_test,
                           base::OnceCallback<void(const SkBitmap&)> callback);
    
      void PrintFrameAsync(blink::WebLocalFrame* web_frame,
                           base::OnceCallback<void(const SkBitmap&)> callback);
    
      base::OnceCallback<void(const SkBitmap&)>
      CreateSelectionBoundsRectDrawingCallback(
          blink::WebLocalFrame* web_frame,
          base::OnceCallback<void(const SkBitmap&)> original_callback);
    
    This change means that it is easier to replace only the new DumpPixelsAsync
    part, while retaining the old behavior for PrintFrameAsync and
    CreateSelectionDrawingCallback.  In particular, a future CL should attempt to
    delegate DumpPixelsAsync to the browser, so that pixels belonging to OOPIFs are
    also captured.
    
    BUG=667551
    
    Review-Url: https://codereview.chromium.org/2963593002
    Cr-Commit-Position: refs/heads/master@{#485774}
    20971a65
test_runner.h 25.6 KB