chromium/chrome/browser/extensions/permissions/permissions_helpers_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.

#include "chrome/browser/extensions/permissions/permissions_helpers.h"

#include <stddef.h>

#include <memory>
#include <utility>

#include "base/json/json_reader.h"
#include "base/values.h"
#include "chrome/browser/extensions/permissions/permissions_test_util.h"
#include "chrome/common/extensions/api/permissions.h"
#include "extensions/common/extension.h"
#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/permissions/permissions_info.h"
#include "extensions/common/permissions/usb_device_permission.h"
#include "extensions/common/url_pattern_set.h"
#include "extensions/common/user_script.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

Permissions;
APIPermissionID;
PackPermissionSet;
UnpackPermissionSet;
UnpackPermissionSetResult;
GetPatternsAsStrings;

namespace extensions {

// Tests that we can convert PermissionSets to the generated types.
TEST(ExtensionPermissionsHelpers, Pack) {}

// Tests various error conditions and edge cases when unpacking Dicts
// into PermissionSets.
TEST(ExtensionPermissionsHelpers, Unpack_Basic) {}

// Tests that host permissions are properly partitioned according to the
// required/optional permission sets.
TEST(ExtensionPermissionsHelpers, Unpack_HostSeparation) {}

// Tests that host permissions are properly partitioned according to the
// required/optional permission sets.
TEST(ExtensionPermissionsHelpers, Unpack_APISeparation) {}

// Tests that unpacking works correctly with wildcard schemes (which are
// interesting, because they only match http | https, and not all schemes).
TEST(ExtensionPermissionsHelpers, Unpack_WildcardSchemes) {}

// Tests that unpacking <all_urls> correctly includes or omits the file:-scheme.
TEST(ExtensionPermissionsHelpers, Unpack_FileSchemes_AllUrls) {}

// Tests that unpacking a pattern that explicitly specifies the file:-scheme is
// properly placed into the |restricted_file_scheme_patterns| set.
TEST(ExtensionPermissionsHelpers, Unpack_FileSchemes_Specific) {}

// Tests that unpacking a UsbDevicePermission with a list of USB device IDs
// preserves the device list in the result object.
TEST(ExtensionPermissionsHelpers, Unpack_UsbDevicePermission) {}

}  // namespace extensions