chromium/chrome/browser/subresource_filter/subresource_filter_history_observer_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 <set>
#include <string>

#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/subresource_filter/subresource_filter_profile_context_factory.h"
#include "chrome/test/base/testing_profile.h"
#include "components/history/core/browser/history_service.h"
#include "components/history/core/test/history_service_test_util.h"
#include "components/subresource_filter/content/browser/subresource_filter_content_settings_manager.h"
#include "components/subresource_filter/content/browser/subresource_filter_profile_context.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

// Tests that SubresourceFilterHistoryObserver is operating as expected in the
// context of //chrome-level setup of SubresourceFilterProfileContext. More of
// an integration test than a unittest in spirit, but requires unittest
// constructs such as TestingProfile and HistoryService-related unittest
// utilities to be able to perform the needed operations on history.
class SubresourceFilterHistoryObserverTest : public testing::Test {};

// Tests that SubresourceFilterHistoryObserver observes deletions of URLs from
// history and instructs SubresourceFilterContentSettingsManager to delete the
// appropriate site metadata from content settings (if any).
TEST_F(SubresourceFilterHistoryObserverTest,
       HistoryUrlDeleted_ClearsWebsiteSetting) {}

// Tests that SubresourceFilterHistoryObserver observes deletions of all URLs
// from history and instructs SubresourceFilterContentSettingsManager to delete
// all site metadata from content settings.
TEST_F(SubresourceFilterHistoryObserverTest,
       AllHistoryUrlDeleted_ClearsWebsiteSetting) {}