chromium/chrome/browser/share/share_ranking_unittest.cc

// Copyright 2021 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/share/share_ranking.h"

#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/test/bind.h"
#include "chrome/browser/share/fake_share_history.h"
#include "chrome/test/base/testing_profile.h"
#include "components/leveldb_proto/testing/fake_db.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace sharing {

// The static tests are true unit tests that cover the static
// ShareRanking::ComputeHistory method only; to enforce that, they don't set up
// a test fixture, which will cause calls to other ShareRanking methods to
// crash.
ShareRankingStaticTest;

class ShareRankingTest : public testing::Test {};

// The "easy case": the existing usage counts are the same as the current
// ranking, and every app in the ranking is available, so the new ranking and
// the displayed ranking should both be the same as the current ranking, modulo
// the addition of the More target.
TEST(ShareRankingStaticTest, CountsMatchOldRanking) {}

// If the existing ranking includes an above-the-fold app that doesn't exist on
// the system, that app should be replaced by the next available below-the-fold
// app that does.
TEST(ShareRankingStaticTest, UnavailableAppDoesNotShow) {}

TEST(ShareRankingStaticTest, HighAllUsageAppReplacesLowest) {}

TEST(ShareRankingStaticTest, HighRecentUsageAppReplacesLowest) {}

TEST(ShareRankingStaticTest, MoreTargetReplacesLast) {}

TEST_F(ShareRankingStaticTest, PromotedTargetIsVisible) {}

TEST_F(ShareRankingStaticTest, UsedAppNotPresentInRanking) {}

TEST_F(ShareRankingStaticTest, LowestUsageItemSwappedIgnoringDisplayOrder) {}

TEST_F(ShareRankingStaticTest, SystemAppsReplaceUnavailableInRankedOrder) {}

TEST_F(ShareRankingStaticTest, NotEnoughPreferredApps) {}

TEST_F(ShareRankingStaticTest, SwapAboveFold) {}

// Regression test for https://crbug.com/1233232
TEST_F(ShareRankingTest, OldRankingContainsItemsWithNoRecentHistory) {}

TEST_F(ShareRankingTest, InitialStateNoHistory) {}

TEST_F(ShareRankingTest, DISABLED_AllHistoryUpdatesRanking) {}

TEST_F(ShareRankingTest, DISABLED_NoPersistDoesNotPersist) {}

TEST_F(ShareRankingTest, DISABLED_RecentHistoryUpdatesRanking) {}

TEST_F(ShareRankingTest, ClearClearsDatabase) {}

}  // namespace sharing