Commit b02c7f36 authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Fix GetAllPermissionTypes() returning invalid permission types

CLIPBOARD_READ and CLIPBOARD_WRITE were removed in
https://crrev.com/c/1895749 but the corresponding change was not made in
GetAllPermissionTypes().

Bug: 897289, 1025609
Change-Id: I63c6a7381bbdf2d1a27f5107524d13aacd995238
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2103551
Auto-Submit: Clark DuVall <cduvall@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751305}
parent 3c8b9b70
...@@ -20,9 +20,9 @@ const std::vector<PermissionType>& GetAllPermissionTypes() { ...@@ -20,9 +20,9 @@ const std::vector<PermissionType>& GetAllPermissionTypes() {
kAllPermissionTypes([] { kAllPermissionTypes([] {
const int NUM_TYPES = static_cast<int>(PermissionType::NUM); const int NUM_TYPES = static_cast<int>(PermissionType::NUM);
std::vector<PermissionType> all_types; std::vector<PermissionType> all_types;
all_types.reserve(NUM_TYPES - 2); all_types.reserve(NUM_TYPES - 4);
for (int i = 1; i < NUM_TYPES; ++i) { for (int i = 1; i < NUM_TYPES; ++i) {
if (i == 2) // Skip PUSH_MESSAGING. if (i == 2 || i == 14 || i == 15) // Skip removed entries.
continue; continue;
all_types.push_back(static_cast<PermissionType>(i)); all_types.push_back(static_cast<PermissionType>(i));
} }
......
...@@ -16,7 +16,7 @@ TEST(PermissionTypeHelpersTest, AllPermissionTypesSmokeTest) { ...@@ -16,7 +16,7 @@ TEST(PermissionTypeHelpersTest, AllPermissionTypesSmokeTest) {
// All but PermissionType::NUM should be added. // All but PermissionType::NUM should be added.
EXPECT_EQ(all_permission_types.size(), EXPECT_EQ(all_permission_types.size(),
static_cast<unsigned long>(PermissionType::NUM) - 2); static_cast<unsigned long>(PermissionType::NUM) - 4);
// Check that some arbitrary permission types are in this vector. // Check that some arbitrary permission types are in this vector.
// The order is not relevant. // The order is not relevant.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment