- // Creates an instance of this object. Implementers of this interface should
- // implement this method to create an object of their implementation.
- static std::unique_ptr<PrintingContext> Create(Delegate* delegate);
+#if BUILDFLAG(IS_WIN)
+ // Initializes with predefined settings.
+ virtual mojom::ResultCode InitWithSettingsForTest(
+ std::unique_ptr<PrintSettings> settings) = 0;
+#endif
+
+ // Creates an instance of this object.
+ static std::unique_ptr<PrintingContext> Create(Delegate* delegate,
+ bool skip_system_calls);
+
+ // Test method for generating printing contexts for testing. This overrides
+ // the platform-specific implementations of CreateImpl().
+ static void SetPrintingContextFactoryForTest(
+ PrintingContextFactoryForTest* factory);