Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1362)

Unified Diff: chrome/browser/extensions/extension_management_unittest.cc

Issue 2961033002: Use ContainsValue() instead of std::find() in chrome/browser/extensions (Closed)
Patch Set: Reverted code changes in language_settings_private_api.cc:307 Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_management.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_management_unittest.cc
diff --git a/chrome/browser/extensions/extension_management_unittest.cc b/chrome/browser/extensions/extension_management_unittest.cc
index fbb2c70a4f99d8259ca40ff119d7587bd59e3ab7..bccd8b64ffef8efceb425ddef3a46212a688390b 100644
--- a/chrome/browser/extensions/extension_management_unittest.cc
+++ b/chrome/browser/extensions/extension_management_unittest.cc
@@ -4,13 +4,13 @@
#include "chrome/browser/extensions/extension_management.h"
-#include <algorithm>
#include <memory>
#include <string>
#include <vector>
#include "base/json/json_parser.h"
#include "base/memory/ptr_util.h"
+#include "base/stl_util.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_management_internal.h"
#include "chrome/browser/extensions/extension_management_test_util.h"
@@ -369,15 +369,9 @@ TEST_F(ExtensionManagementServiceTest, LegacyAllowedTypes) {
ReadGlobalSettings()->allowed_types;
ASSERT_TRUE(ReadGlobalSettings()->has_restricted_allowed_types);
EXPECT_EQ(allowed_types.size(), 2u);
- EXPECT_FALSE(std::find(allowed_types.begin(),
- allowed_types.end(),
- Manifest::TYPE_EXTENSION) != allowed_types.end());
- EXPECT_TRUE(std::find(allowed_types.begin(),
- allowed_types.end(),
- Manifest::TYPE_THEME) != allowed_types.end());
- EXPECT_TRUE(std::find(allowed_types.begin(),
- allowed_types.end(),
- Manifest::TYPE_USER_SCRIPT) != allowed_types.end());
+ EXPECT_FALSE(base::ContainsValue(allowed_types, Manifest::TYPE_EXTENSION));
+ EXPECT_TRUE(base::ContainsValue(allowed_types, Manifest::TYPE_THEME));
+ EXPECT_TRUE(base::ContainsValue(allowed_types, Manifest::TYPE_USER_SCRIPT));
}
// Verify that preference controlled by legacy ExtensionInstallBlacklist policy
@@ -484,12 +478,8 @@ TEST_F(ExtensionManagementServiceTest, PreferenceParsing) {
const std::vector<Manifest::Type>& allowed_types =
ReadGlobalSettings()->allowed_types;
EXPECT_EQ(allowed_types.size(), 2u);
- EXPECT_TRUE(std::find(allowed_types.begin(),
- allowed_types.end(),
- Manifest::TYPE_THEME) != allowed_types.end());
- EXPECT_TRUE(std::find(allowed_types.begin(),
- allowed_types.end(),
- Manifest::TYPE_USER_SCRIPT) != allowed_types.end());
+ EXPECT_TRUE(base::ContainsValue(allowed_types, Manifest::TYPE_THEME));
+ EXPECT_TRUE(base::ContainsValue(allowed_types, Manifest::TYPE_USER_SCRIPT));
// Verifies blocked permission list settings.
APIPermissionSet api_permission_set;
« no previous file with comments | « chrome/browser/extensions/extension_management.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698