chromium/chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc

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

#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"

#include <stdint.h>

#include <vector>

#include "base/memory/ref_counted_memory.h"
#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "chrome/browser/printing/print_preview_test.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_handler.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "components/prefs/pref_service.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/test/scoped_web_ui_controller_factory_registration.h"
#include "printing/print_job_constants.h"

WebContents;
WebContentsModalDialogManager;

namespace printing {

namespace {

scoped_refptr<base::RefCountedBytes> CreateTestData() {}

bool IsShowingWebContentsModalDialog(WebContents* tab) {}

// A fake that just ignores `BadMessageReceived()` calls.
class FakePrintPreviewHandler : public PrintPreviewHandler {};

// A fake that uses `FakePrintPreviewHandler` instead of the real one.
class FakePrintPreviewUI : public PrintPreviewUI {};

// Hands out `FakePrintPreviewUI` instances instead of real ones.
class TestPrintPreviewUIConfig
    : public content::DefaultWebUIConfig<FakePrintPreviewUI> {};

}  // namespace

class PrintPreviewUIUnitTest : public PrintPreviewTest {};

// Create/Get a preview tab for initiator.
TEST_F(PrintPreviewUIUnitTest, PrintPreviewData) {}

// Set and get the individual draft pages.
TEST_F(PrintPreviewUIUnitTest, PrintPreviewDraftPages) {}

// Test the browser-side print preview cancellation functionality.
TEST_F(PrintPreviewUIUnitTest, ShouldCancelRequest) {}

// Ensures that a failure cancels all pending actions.
TEST_F(PrintPreviewUIUnitTest, PrintPreviewFailureCancelsPendingActions) {}

TEST_F(PrintPreviewUIUnitTest, GetPageToNupConvertIndexWithNoPagesToRender) {}

TEST_F(PrintPreviewUIUnitTest,
       GetPageToNupConvertIndexWithPartialPagesToRender) {}

TEST_F(PrintPreviewUIUnitTest, GetPageToNupConvertIndexWithAllPagesToRender) {}

}  // namespace printing