chromium/chrome/common/extensions/api/common_extension_api_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include <stddef.h>

#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/threading/thread.h"
#include "base/values.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension_features_unittest.h"
#include "extensions/common/api/extension_action/action_info.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_api.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/features/feature_session_type.h"
#include "extensions/common/features/simple_feature.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/mojom/context_type.mojom.h"
#include "extensions/common/mojom/feature_session_type.mojom.h"
#include "extensions/test/test_context_data.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace extensions {

namespace {

const char* const kTestFeatures[] =;

const char* const kAliasTestApis[] =;

const char* const kSessionTypeTestFeatures[] =;

struct FeatureSessionTypesTestData {};

class TestExtensionAPI : public ExtensionAPI {};

}  // namespace

TEST(ExtensionAPITest, Creation) {}

TEST(ExtensionAPITest, SplitDependencyName) {}

TEST(ExtensionAPITest, APIFeatures) {}

TEST(ExtensionAPITest, APIFeaturesAlias) {}

TEST(ExtensionAPITest, IsAnyFeatureAvailableToContext) {}

TEST(ExtensionAPITest, SessionTypeFeature) {}

TEST(ExtensionAPITest, LazyGetSchema) {}

scoped_refptr<Extension> CreateExtensionWithPermissions(
    const std::set<std::string>& permissions) {}

scoped_refptr<Extension> CreateExtensionWithPermission(
    const std::string& permission) {}

TEST(ExtensionAPITest, ExtensionWithUnprivilegedAPIs) {}

scoped_refptr<Extension> CreateHostedApp() {}

scoped_refptr<Extension> CreatePackagedAppWithPermissions(
    const std::set<std::string>& permissions) {}

TEST(ExtensionAPITest, HostedAppPermissions) {}

TEST(ExtensionAPITest, AppAndFriendsAvailability) {}

TEST(ExtensionAPITest, ExtensionWithDependencies) {}

bool MatchesURL(
    ExtensionAPI* api, const std::string& api_name, const std::string& url) {}

TEST(ExtensionAPITest, URLMatching) {}

TEST(ExtensionAPITest, GetAPINameFromFullName) {}

TEST(ExtensionAPITest, DefaultConfigurationFeatures) {}

static const base::Value::Dict* GetDictChecked(const base::Value::Dict* dict,
                                               const std::string& key) {}

static std::string GetStringChecked(const base::Value::Dict* dict,
                                    const std::string& key) {}

TEST(ExtensionAPITest, TypesHaveNamespace) {}

// Tests API availability with an empty manifest.
TEST(ExtensionAPITest, NoPermissions) {}

// Tests that permissions that require manifest keys are available when those
// keys are present.
TEST(ExtensionAPITest, ManifestKeys) {}

// (TSAN) Tests that ExtensionAPI are able to handle GetSchema from different
// threads.
TEST(ExtensionAPITest, GetSchemaFromDifferentThreads) {}

}  // namespace extensions