chromium/extensions/common/api/declarative_net_request/dnr_manifest_unittest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <string_view>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/json/json_file_value_serializer.h"
#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "extensions/common/api/declarative_net_request.h"
#include "extensions/common/api/declarative_net_request/constants.h"
#include "extensions/common/api/declarative_net_request/dnr_manifest_data.h"
#include "extensions/common/api/declarative_net_request/test_utils.h"
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension.h"
#include "extensions/common/file_util.h"
#include "extensions/common/manifest_constants.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace extensions {

errors;
dnr_api;

namespace declarative_net_request {
namespace {

std::string GetRuleResourcesPath() {}

// Fixture testing the kDeclarativeNetRequestKey manifest key.
class DNRManifestTest : public testing::Test {};

TEST_F(DNRManifestTest, EmptyRuleset) {}

TEST_F(DNRManifestTest, InvalidManifestKey) {}

TEST_F(DNRManifestTest, InvalidRulesFileKey) {}

TEST_F(DNRManifestTest, InvalidRulesFileFormat) {}

TEST_F(DNRManifestTest, InvalidRulesetPath) {}

TEST_F(DNRManifestTest, InvalidRulesetPath2) {}

TEST_F(DNRManifestTest, ZeroRulesets) {}

TEST_F(DNRManifestTest, MultipleRulesFileSuccess) {}

TEST_F(DNRManifestTest, MultipleRulesFileInvalidPath) {}

TEST_F(DNRManifestTest, RulesetCountExceeded) {}

TEST_F(DNRManifestTest, EnabledRulesetCountExceeded) {}

TEST_F(DNRManifestTest, NonExistentRulesFile) {}

TEST_F(DNRManifestTest, NeedsDeclarativeNetRequestPermission) {}

TEST_F(DNRManifestTest, RulesFileInNestedDirectory) {}

TEST_F(DNRManifestTest, EmptyRulesetID) {}

TEST_F(DNRManifestTest, DuplicateRulesetID) {}

TEST_F(DNRManifestTest, ReservedRulesetID) {}

// The webstore installation flow involves creation of a dummy extension with an
// empty extension root path. Ensure the manifest handler for declarative net
// request handles it correctly. Regression test for crbug.com/1087348.
TEST_F(DNRManifestTest, EmptyExtensionRootPath) {}

TEST_F(DNRManifestTest, EmptyRulesetPath1) {}

TEST_F(DNRManifestTest, EmptyRulesetPath2) {}

TEST_F(DNRManifestTest, DuplicateRulesetPath) {}

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