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

Unified Diff: extensions/browser/error_map_unittest.cc

Issue 1016413004: [Extensions] Update Error Console UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « extensions/browser/error_map.cc ('k') | third_party/closure_compiler/externs/developer_private.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/error_map_unittest.cc
diff --git a/extensions/browser/error_map_unittest.cc b/extensions/browser/error_map_unittest.cc
index b8ae20d062cee017f5565632d95442dfafe982d6..f3880c68f3ff6c63ecf878020a1e7cfc4af46049 100644
--- a/extensions/browser/error_map_unittest.cc
+++ b/extensions/browser/error_map_unittest.cc
@@ -51,11 +51,14 @@ TEST_F(ErrorMapUnitTest, AddAndRemoveErrors) {
// Remove the incognito errors; three errors should remain, and all should
// be from non-incognito contexts.
- errors_.RemoveErrors(ErrorMap::Filter::IncognitoErrors());
+ std::set<std::string> affected_ids;
+ errors_.RemoveErrors(ErrorMap::Filter::IncognitoErrors(), &affected_ids);
const ErrorList& list = errors_.GetErrorsForExtension(kId);
EXPECT_EQ(kNumNonIncognitoErrors, list.size());
for (size_t i = 0; i < list.size(); ++i)
EXPECT_FALSE(list[i]->from_incognito());
+ EXPECT_EQ(1u, affected_ids.size());
+ EXPECT_TRUE(affected_ids.count(kId));
// Add another error for a different extension id.
const std::string kSecondId = crx_file::id_util::GenerateId("id2");
@@ -67,16 +70,20 @@ TEST_F(ErrorMapUnitTest, AddAndRemoveErrors) {
EXPECT_EQ(1u, errors_.GetErrorsForExtension(kSecondId).size());
// Remove all errors for the second id.
- errors_.RemoveErrors(ErrorMap::Filter::ErrorsForExtension(kSecondId));
+ affected_ids.clear();
+ errors_.RemoveErrors(ErrorMap::Filter::ErrorsForExtension(kSecondId),
+ &affected_ids);
EXPECT_EQ(0u, errors_.GetErrorsForExtension(kSecondId).size());
// First extension should be unaffected.
EXPECT_EQ(kNumNonIncognitoErrors, errors_.GetErrorsForExtension(kId).size());
+ EXPECT_EQ(1u, affected_ids.size());
+ EXPECT_TRUE(affected_ids.count(kSecondId));
errors_.AddError(CreateNewManifestError(kId, "manifest error"));
EXPECT_EQ(kNumNonIncognitoErrors + 1,
errors_.GetErrorsForExtension(kId).size());
errors_.RemoveErrors(ErrorMap::Filter::ErrorsForExtensionWithType(
- kId, ExtensionError::MANIFEST_ERROR));
+ kId, ExtensionError::MANIFEST_ERROR), nullptr);
EXPECT_EQ(kNumNonIncognitoErrors, errors_.GetErrorsForExtension(kId).size());
const ExtensionError* added_error =
@@ -85,7 +92,8 @@ TEST_F(ErrorMapUnitTest, AddAndRemoveErrors) {
errors_.GetErrorsForExtension(kId).size());
std::set<int> ids;
ids.insert(added_error->id());
- errors_.RemoveErrors(ErrorMap::Filter::ErrorsForExtensionWithIds(kId, ids));
+ errors_.RemoveErrors(ErrorMap::Filter::ErrorsForExtensionWithIds(kId, ids),
+ nullptr);
EXPECT_EQ(kNumNonIncognitoErrors, errors_.GetErrorsForExtension(kId).size());
// Remove remaining errors.
« no previous file with comments | « extensions/browser/error_map.cc ('k') | third_party/closure_compiler/externs/developer_private.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698