diff options
author | rdevlin.cronin <rdevlin.cronin@chromium.org> | 2015-04-29 09:51:43 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-29 16:53:03 +0000 |
commit | 20bf10bc2f45275a9473b8121447b44810bb4909 (patch) | |
tree | 85fe91142ca92a443d245b94c3d5829bfc436010 /extensions/browser/error_map_unittest.cc | |
parent | ccb7359c4a7948b3a7a639342037b856de9fe82c (diff) | |
download | chromium_src-20bf10bc2f45275a9473b8121447b44810bb4909.zip chromium_src-20bf10bc2f45275a9473b8121447b44810bb4909.tar.gz chromium_src-20bf10bc2f45275a9473b8121447b44810bb4909.tar.bz2 |
[Extensions] Update Error Console UI
The current Error Console UI is a little lacking. Most egregiously, there's no
way to clear errors. Update the UI by moving more of the error console into its
dedicated overlay, which
- Minimizes its footprint on the main page.
- Makes it easy to switch between errors easily.
Additionally, add support for removing specific (or all) errors associated with
extensions.
Screenshots are up at
https://drive.google.com/open?id=0BxjK6_MzZ8UPfndZcElPVGxxdWxXQmN3WkVtSFhNUkN3SlFVYVQtaGlpWTJaOU52YTRfOGs&authuser=0
(Internal only for now; will post externally soon)
BUG=482526
Review URL: https://codereview.chromium.org/1016413004
Cr-Commit-Position: refs/heads/master@{#327509}
Diffstat (limited to 'extensions/browser/error_map_unittest.cc')
-rw-r--r-- | extensions/browser/error_map_unittest.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/extensions/browser/error_map_unittest.cc b/extensions/browser/error_map_unittest.cc index b8ae20d..f3880c6 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. |