chromium/content/browser/renderer_host/view_transition_browsertest.cc

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

#include "base/test/scoped_feature_list.h"
#include "components/viz/host/host_frame_sink_manager.h"
#include "content/browser/compositor/surface_utils.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/view_transition_opt_in_state.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/test/back_forward_cache_util.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/shell/browser/shell.h"
#include "content/shell/browser/shell_download_manager_delegate.h"
#include "content/test/content_browser_test_utils_internal.h"
#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/default_handlers.h"
#include "services/viz/privileged/mojom/compositing/features.mojom-features.h"
#include "third_party/blink/public/common/features.h"

namespace content {

class ViewTransitionBrowserTest : public ContentBrowserTest {};

IN_PROC_BROWSER_TEST_F(ViewTransitionBrowserTest,
                       NavigationCancelledAfterScreenshot) {}

IN_PROC_BROWSER_TEST_F(ViewTransitionBrowserTest,
                       NavigationCancelledBeforeScreenshot) {}

IN_PROC_BROWSER_TEST_F(ViewTransitionBrowserTest,
                       OwnershipTransferredToNewRenderer) {}

// Ensure a browser-initiated navigation (i.e. typing URL into omnibox) does
// not trigger a view transitions.
IN_PROC_BROWSER_TEST_F(ViewTransitionBrowserTest,
                       NoOpOnBrowserInitiatedNavigations) {}

class ViewTransitionDownloadBrowserTest : public ViewTransitionBrowserTest {};

IN_PROC_BROWSER_TEST_F(ViewTransitionDownloadBrowserTest,
                       NavigationToDownloadLink) {}

class ViewTransitionBrowserTestTraverse
    : public ViewTransitionBrowserTest,
      public testing::WithParamInterface<bool> {};

IN_PROC_BROWSER_TEST_P(ViewTransitionBrowserTestTraverse,
                       NavigateEventFiresBeforeCapture) {}

// A session restore (e.g. "Duplicate Tab", "Undo Close Tab") uses RESTORE
// navigation types when traversing the session history. Ensure these
// navigations trigger a view transition.
IN_PROC_BROWSER_TEST_P(ViewTransitionBrowserTestTraverse,
                       TransitionOnSessionRestoreTraversal) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace content