chromium/chrome/browser/performance_manager/policies/background_tab_loading_policy_unittest.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 "chrome/browser/performance_manager/policies/background_tab_loading_policy.h"

#include <map>
#include <memory>
#include <vector>

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "chrome/browser/performance_manager/mechanisms/page_loader.h"
#include "components/performance_manager/graph/graph_impl.h"
#include "components/performance_manager/graph/page_node_impl.h"
#include "components/performance_manager/public/persistence/site_data/site_data_reader.h"
#include "components/performance_manager/test_support/graph_test_harness.h"
#include "components/performance_manager/test_support/persistence/test_site_data_reader.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace performance_manager {

namespace policies {

PageNodeData;

namespace {

// Mock version of a performance_manager::mechanism::PageLoader.
class LenientMockPageLoader
    : public performance_manager::mechanism::PageLoader {};
MockPageLoader;

class MockBackgroundTabLoadingPolicy : public BackgroundTabLoadingPolicy {};

}  // namespace

class BackgroundTabLoadingPolicyTest : public GraphTestHarness {};

TEST_F(BackgroundTabLoadingPolicyTest,
       ScheduleLoadForRestoredTabsWithoutNotificationPermission) {}

TEST_F(BackgroundTabLoadingPolicyTest,
       ScheduleLoadForRestoredTabsWithNotificationPermission) {}

TEST_F(BackgroundTabLoadingPolicyTest, AllLoadingSlotsUsed) {}

// Regression test for crbug.com/1166745
TEST_F(BackgroundTabLoadingPolicyTest, LoadingStateLoadedBusy) {}

TEST_F(BackgroundTabLoadingPolicyTest, ShouldLoad_MaxTabsToRestore) {}

TEST_F(BackgroundTabLoadingPolicyTest, ShouldLoad_MinTabsToRestore) {}

TEST_F(BackgroundTabLoadingPolicyTest, ShouldLoad_FreeMemory) {}

TEST_F(BackgroundTabLoadingPolicyTest, ShouldLoad_OldTab) {}

// Regression test for https://crrev.com/c/3909768: Deleting a PageNode with the
// notification permission before it starts loading but before it is scored
// should not decrement the number of tabs scored.
TEST_F(BackgroundTabLoadingPolicyTest, RemoveTabWithNotificationPermission) {}

TEST_F(BackgroundTabLoadingPolicyTest, ScoreAndScheduleTabLoad) {}

TEST_F(BackgroundTabLoadingPolicyTest, OnMemoryPressure) {}

}  // namespace policies

}  // namespace performance_manager