chromium/chrome/browser/printing/test_print_view_manager_for_request_preview.h

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_PRINTING_TEST_PRINT_VIEW_MANAGER_FOR_REQUEST_PREVIEW_H_
#define CHROME_BROWSER_PRINTING_TEST_PRINT_VIEW_MANAGER_FOR_REQUEST_PREVIEW_H_

#include "base/functional/callback_forward.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "components/printing/common/print.mojom.h"

namespace content {
class WebContents;
}

namespace printing {

// A helper class for testing PrintViewManager::RequestPrintPreview().
// When printing::StartPrint is called in a browser test, the browser process
// communicates with a renderer process using mojo API. The rendered should call
// PrintViewManager::RequestPrintPreview(). However, due to asynchronous
// execution, it is possible that the test fixture will end before this call
// happens. TestPrintViewManagerForRequestPreview helps to set up
// synchronisation using base::RunLoop.
class TestPrintViewManagerForRequestPreview : public PrintViewManager {};

}  // namespace printing

#endif  // CHROME_BROWSER_PRINTING_TEST_PRINT_VIEW_MANAGER_FOR_REQUEST_PREVIEW_H_