// Copyright 2014 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_PRINTING_TEST_MOCK_PRINTER_H_ #define COMPONENTS_PRINTING_TEST_MOCK_PRINTER_H_ #include <stdint.h> #include <memory> #include <string> #include <vector> #include "base/memory/ref_counted.h" #include "components/printing/common/print.mojom.h" #include "pdf/buildflags.h" #include "printing/image.h" #include "printing/mojom/print.mojom.h" #include "printing/units.h" #include "ui/gfx/geometry/rect_f.h" #include "ui/gfx/geometry/size_f.h" #if BUILDFLAG(ENABLE_PDF) #define MOCK_PRINTER_SUPPORTS_PAGE_IMAGES #endif namespace base { class ReadOnlySharedMemoryMapping; } // namespace base namespace printing { // A class which represents an output page used in the MockPrinter class. // The MockPrinter class stores output pages in a vector, so, this class // inherits the base::RefCounted<> class so that the MockPrinter class can use // a smart pointer of this object (i.e. scoped_refptr<>). class MockPrinterPage : public base::RefCounted<MockPrinterPage> { … }; // A class which implements a pseudo-printer object used by the RenderViewTest // class. // This class consists of three parts: // 1. An IPC-message hanlder sent from the RenderView class; // 2. A renderer that creates a printing job into bitmaps, and; // 3. A vector which saves the output pages of a printing job. // A user who writes RenderViewTest cases only use the functions which // retrieve output pages from this vector to verify them with expected results. class MockPrinter { … }; } // namespace printing #endif // COMPONENTS_PRINTING_TEST_MOCK_PRINTER_H_