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

Unified Diff: chrome/browser/chromeos/extensions/gfx_utils_unittest.cc

Issue 2934043002: Use ContainsValue() instead of std::find() in chrome/browser/chromeos (Closed)
Patch Set: Fixed compilation error. Created 3 years, 6 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
Index: chrome/browser/chromeos/extensions/gfx_utils_unittest.cc
diff --git a/chrome/browser/chromeos/extensions/gfx_utils_unittest.cc b/chrome/browser/chromeos/extensions/gfx_utils_unittest.cc
index 18ee479a14cfd4457327b095606b8336b51a9d43..b29934e772409b4aa549fb56bbb8dc2a3935f259 100644
--- a/chrome/browser/chromeos/extensions/gfx_utils_unittest.cc
+++ b/chrome/browser/chromeos/extensions/gfx_utils_unittest.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/extensions/gfx_utils.h"
#include "base/macros.h"
+#include "base/stl_util.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/profiles/profile.h"
@@ -163,8 +164,7 @@ TEST_F(DualBadgeMapTest, ArcAppToExtensionMapTest) {
extension_ids = extensions::util::GetEquivalentInstalledExtensions(
profile(), kGmailArcPackage);
EXPECT_TRUE(1 == extension_ids.size());
- EXPECT_TRUE(std::find(extension_ids.begin(), extension_ids.end(),
- kGmailExtensionId1) != extension_ids.end());
+ EXPECT_TRUE(base::ContainsValue(extension_ids, kGmailExtensionId1));
// Install another Gmail extension app.
scoped_refptr<Extension> extension2 = CreateExtension(kGmailExtensionId2);
@@ -172,19 +172,15 @@ TEST_F(DualBadgeMapTest, ArcAppToExtensionMapTest) {
extension_ids = extensions::util::GetEquivalentInstalledExtensions(
profile(), kGmailArcPackage);
EXPECT_TRUE(2 == extension_ids.size());
- EXPECT_TRUE(std::find(extension_ids.begin(), extension_ids.end(),
- kGmailExtensionId1) != extension_ids.end());
- EXPECT_TRUE(std::find(extension_ids.begin(), extension_ids.end(),
- kGmailExtensionId2) != extension_ids.end());
+ EXPECT_TRUE(base::ContainsValue(extension_ids, kGmailExtensionId1));
+ EXPECT_TRUE(base::ContainsValue(extension_ids, kGmailExtensionId2));
RemoveExtension(extension1.get());
extension_ids = extensions::util::GetEquivalentInstalledExtensions(
profile(), kGmailArcPackage);
EXPECT_TRUE(1 == extension_ids.size());
- EXPECT_FALSE(std::find(extension_ids.begin(), extension_ids.end(),
- kGmailExtensionId1) != extension_ids.end());
- EXPECT_TRUE(std::find(extension_ids.begin(), extension_ids.end(),
- kGmailExtensionId2) != extension_ids.end());
+ EXPECT_FALSE(base::ContainsValue(extension_ids, kGmailExtensionId1));
+ EXPECT_TRUE(base::ContainsValue(extension_ids, kGmailExtensionId2));
RemoveExtension(extension2.get());
extension_ids = extensions::util::GetEquivalentInstalledExtensions(

Powered by Google App Engine
This is Rietveld 408576698