chromium/chrome/browser/paint_preview/paint_preview_compositor_browsertest.cc

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

#include <memory>
#include <utility>
#include <vector>

#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/gtest_util.h"
#include "base/unguessable_token.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/paint_preview/browser/compositor_utils.h"
#include "components/paint_preview/browser/paint_preview_base_service_test_factory.h"
#include "components/paint_preview/browser/paint_preview_compositor_client_impl.h"
#include "components/paint_preview/browser/paint_preview_compositor_service_impl.h"
#include "components/paint_preview/browser/warm_compositor.h"
#include "components/paint_preview/public/paint_preview_compositor_client.h"
#include "components/paint_preview/public/paint_preview_compositor_service.h"
#include "components/services/paint_preview_compositor/public/mojom/paint_preview_compositor.mojom.h"
#include "content/public/browser/service_process_host.h"
#include "content/public/test/browser_test.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace paint_preview {

namespace {

// These functions cast the public API for the CompositorService and
// CompositorClient to the *Impl versions. This exposes some internal test-only
// methods to validate internal state.

std::unique_ptr<PaintPreviewCompositorServiceImpl> ToCompositorServiceImpl(
    std::unique_ptr<PaintPreviewCompositorService, base::OnTaskRunnerDeleter>
        service) {}

std::unique_ptr<PaintPreviewCompositorClientImpl> ToCompositorClientImpl(
    std::unique_ptr<PaintPreviewCompositorClient, base::OnTaskRunnerDeleter>
        client) {}

bool IsBoundAndConnected(PaintPreviewCompositorClientImpl* compositor) {}

}  // namespace

class PaintPreviewCompositorBrowserTest : public InProcessBrowserTest {};

// Test that a "true" initialization works and doesn't crash.
IN_PROC_BROWSER_TEST_F(PaintPreviewCompositorBrowserTest,
                       TestInitializationSuccess) {}

IN_PROC_BROWSER_TEST_F(PaintPreviewCompositorBrowserTest, CompositorCreate) {}

IN_PROC_BROWSER_TEST_F(PaintPreviewCompositorBrowserTest,
                       MultipleCompositorCreate) {}

IN_PROC_BROWSER_TEST_F(PaintPreviewCompositorBrowserTest,
                       KillWithActiveCompositors) {}

IN_PROC_BROWSER_TEST_F(PaintPreviewCompositorBrowserTest, PreWarmCompositor) {}

}  // namespace paint_preview