chromium/chrome/browser/performance_manager/frame_node_impl_browsertest.cc

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

#include "components/performance_manager/graph/frame_node_impl.h"

#include "base/functional/callback.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/performance_manager/graph/page_node_impl.h"
#include "components/performance_manager/performance_manager_impl.h"
#include "components/performance_manager/public/graph/page_node.h"
#include "components/performance_manager/test_support/run_in_graph.h"
#include "content/public/test/back_forward_cache_util.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/prerender_test_util.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rect_f.h"

namespace performance_manager {

_;

namespace {

// Sends a 'p' key press to the page, simulating a user edit if a text field is
// focused.
void SimulateKeyPress(content::WebContents* web_contents) {}

class FrameNodeImplBrowserTest : public InProcessBrowserTest {};

// Templated PassToGraph helper that also returns a pointer to the object.
template <typename DerivedType>
DerivedType* PassToPMGraph(std::unique_ptr<DerivedType> graph_owned) {}

// A FrameNodeObserver that allows waiting until a frame's viewport intersection
// state is initialized to a set value.
class ViewportIntersectionStateChangedObserver
    : public GraphOwned,
      public FrameNode::ObserverDefaultImpl {};

}  // namespace

IN_PROC_BROWSER_TEST_F(FrameNodeImplBrowserTest,
                       ViewportIntersection_OutOfView) {}

IN_PROC_BROWSER_TEST_F(FrameNodeImplBrowserTest, ViewportIntersection_Hidden) {}

IN_PROC_BROWSER_TEST_F(FrameNodeImplBrowserTest,
                       ViewportIntersection_PartiallyVisible) {}

IN_PROC_BROWSER_TEST_F(FrameNodeImplBrowserTest, ViewportIntersection_Scaled) {}

IN_PROC_BROWSER_TEST_F(FrameNodeImplBrowserTest, ViewportIntersection_Rotated) {}

// For the following tests, listen to OnHadFormInteractionChanged() to ensure
// that the DocumentCoordinationUnit interface is correctly bound.
class MockFrameNodeObserver : public FrameNode::ObserverDefaultImpl {};

IN_PROC_BROWSER_TEST_F(FrameNodeImplBrowserTest, Bind_SimpleNavigation) {}

class FrameNodeImplBackForwardCacheBrowserTest
    : public FrameNodeImplBrowserTest {};

IN_PROC_BROWSER_TEST_F(FrameNodeImplBackForwardCacheBrowserTest,
                       Bind_BackForwardCache) {}

class FrameNodeImplPrerenderBrowserTest : public FrameNodeImplBrowserTest {};

// TODO(362360274): Fix this flaky test.
IN_PROC_BROWSER_TEST_F(FrameNodeImplPrerenderBrowserTest,
                       DISABLED_Bind_PrerenderNavigation) {}

}  // namespace performance_manager