chromium/chrome/browser/extensions/api/declarative_net_request/action_tracker_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 "extensions/browser/api/declarative_net_request/action_tracker.h"

#include <string_view>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/test/simple_test_clock.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/time/time.h"
#include "chrome/browser/extensions/api/declarative_net_request/dnr_test_base.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "extensions/browser/api/web_request/web_request_info.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_util.h"
#include "extensions/common/api/declarative_net_request/constants.h"
#include "extensions/common/api/declarative_net_request/test_utils.h"
#include "extensions/common/constants.h"
#include "services/network/public/mojom/fetch_api.mojom-shared.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h"
#include "url/gurl.h"

namespace extensions {
namespace declarative_net_request {

namespace {

constexpr int64_t kNavigationId =;

class ActionTrackerTest : public DNRTestBase {};

// Test that rules matched will be recorded for extensions with the
// declarativeNetRequestFeedback or activeTab permission.
TEST_P(ActionTrackerTest, GetMatchedRulesNoPermission) {}

// Test that rules associated with a non-active tab past their lifetime will be
// removed, and not returned by getMatchedRules
TEST_P(ActionTrackerTest, GetMatchedRulesLifespan) {}

// Test that matched rules not associated with an active tab will be
// automatically cleaned up by a recurring task.
TEST_P(ActionTrackerTest, RulesClearedOnTimer) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace
}  // namespace declarative_net_request
}  // namespace extensions