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

Unified Diff: chrome/common/extensions/permissions/media_galleries_permission_unittest.cc

Issue 237693004: Fix NULL dereference if a extension subpermission is removed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test Created 6 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 | « no previous file | extensions/common/permissions/media_galleries_permission.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/permissions/media_galleries_permission_unittest.cc
diff --git a/chrome/common/extensions/permissions/media_galleries_permission_unittest.cc b/chrome/common/extensions/permissions/media_galleries_permission_unittest.cc
index 71651f9534f02e3a62f0cd76e18aaf9187532580..110a0692578a0c7442f5007933290eaf91abb18e 100644
--- a/chrome/common/extensions/permissions/media_galleries_permission_unittest.cc
+++ b/chrome/common/extensions/permissions/media_galleries_permission_unittest.cc
@@ -158,6 +158,13 @@ TEST(MediaGalleriesPermissionTest, UnknownValues) {
EXPECT_EQ(2U, unhandled.size());
error.clear();
unhandled.clear();
+
+ // Unnknown with a NULL argument.
+ value.reset(new base::ListValue());
+ value->AppendString("Unknown1");
+ EXPECT_FALSE(permission->FromValue(value.get(), &error, NULL));
+ EXPECT_FALSE(error.empty());
+ error.clear();
}
TEST(MediaGalleriesPermissionTest, Equal) {
« no previous file with comments | « no previous file | extensions/common/permissions/media_galleries_permission.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698