chromium/chrome/browser/extensions/api/reading_list/reading_list_api_unittest.cc

// Copyright 2023 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/extensions/api/reading_list/reading_list_api.h"

#include <memory>

#include "base/location.h"
#include "base/test/values_test_util.h"
#include "base/time/time.h"
#include "chrome/browser/extensions/api/reading_list/reading_list_api_constants.h"
#include "chrome/browser/extensions/api/reading_list/reading_list_event_router.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/reading_list/reading_list_model_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/extensions/api/reading_list.h"
#include "chrome/test/base/test_browser_window.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/reading_list/core/reading_list_entry.h"
#include "components/reading_list/core/reading_list_model.h"
#include "components/reading_list/core/reading_list_test_utils.h"
#include "components/version_info/channel.h"
#include "content/public/browser/browser_context.h"
#include "extensions/browser/api_test_utils.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/event_router_factory.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/test_event_router_observer.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/features/feature_channel.h"
#include "url/gurl.h"

namespace extensions {

namespace {

// Create an extension with "readingList" permission.
scoped_refptr<const Extension> CreateReadingListExtension() {}

void AddReadingListEntry(ReadingListModel* reading_list_model,
                         const GURL& url,
                         const std::string& title,
                         bool has_been_read) {}

std::unique_ptr<KeyedService> BuildReadingListEventRouter(
    content::BrowserContext* context) {}

std::unique_ptr<KeyedService> BuildEventRouter(
    content::BrowserContext* context) {}

}  // namespace

class ReadingListApiUnitTest : public ExtensionServiceTestBase {};

void ReadingListApiUnitTest::SetUp() {}

void ReadingListApiUnitTest::TearDown() {}

// Test that it is possible to add a unique URL.
TEST_F(ReadingListApiUnitTest, AddUniqueURL) {}

// Test that it is possible to add an already read entry.
TEST_F(ReadingListApiUnitTest, AddEntryThatHasBeenRead) {}

// Test that adding a duplicate URL generates an error.
TEST_F(ReadingListApiUnitTest, AddDuplicateURL) {}

// Test that it is possible to remove a URL.
TEST_F(ReadingListApiUnitTest, RemoveURL) {}

// Test that trying to remove a URL that is not in the Reading List, generates
// an error.
TEST_F(ReadingListApiUnitTest, RemoveNonExistentURL) {}

// Test that it is possible to update the features of an entry.
TEST_F(ReadingListApiUnitTest, UpdateEntryFeatures) {}

// Test that trying to update an entry by providing only the URL, generates an
// error.
TEST_F(ReadingListApiUnitTest, UpdateEntryOnlyWithTheURL) {}

// Test that it is possible to retrieve all the entries.
TEST_F(ReadingListApiUnitTest, RetrieveAllEntries) {}

// Test that it is possible to retrieve entries with certain features.
TEST_F(ReadingListApiUnitTest, RetrieveCertainEntries) {}

// Test that a query can return no matching entries.
TEST_F(ReadingListApiUnitTest, NoEntriesRetrieved) {}

// Test that adding an entry generates an event.
TEST_F(ReadingListApiUnitTest, ReadingListOnEntryAdded) {}

// Test that removing an entry generates an event.
TEST_F(ReadingListApiUnitTest, ReadingListOnEntryRemoved) {}

// Test that updating an entry generates an event.
TEST_F(ReadingListApiUnitTest, ReadingListOnEntryUpdated) {}

}  // namespace extensions