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

Unified Diff: extensions/browser/management_policy_unittest.cc

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: extensions/browser/management_policy_unittest.cc
diff --git a/extensions/browser/management_policy_unittest.cc b/extensions/browser/management_policy_unittest.cc
index 52373c135ba75b1638b1a60280d690884bf7a103..809c4e1ad2a4bec5f4b7b437cc5178cc69172171 100644
--- a/extensions/browser/management_policy_unittest.cc
+++ b/extensions/browser/management_policy_unittest.cc
@@ -66,113 +66,113 @@ TEST_F(ManagementPolicyTest, UserMayLoad) {
base::string16 error;
// The extension and location are irrelevant to the
// TestManagementPolicyProviders.
- EXPECT_TRUE(policy_.UserMayLoad(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayLoad(nullptr, &error));
EXPECT_TRUE(error.empty());
// One provider, no relevant restriction.
policy_.RegisterProvider(&no_modify_status_);
- EXPECT_TRUE(policy_.UserMayLoad(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayLoad(nullptr, &error));
EXPECT_TRUE(error.empty());
// Two providers, no relevant restrictions.
policy_.RegisterProvider(&must_remain_enabled_);
- EXPECT_TRUE(policy_.UserMayLoad(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayLoad(nullptr, &error));
EXPECT_TRUE(error.empty());
// Three providers, one with a relevant restriction.
policy_.RegisterProvider(&no_load_);
- EXPECT_FALSE(policy_.UserMayLoad(NULL, &error));
+ EXPECT_FALSE(policy_.UserMayLoad(nullptr, &error));
EXPECT_FALSE(error.empty());
// Remove the restriction.
policy_.UnregisterProvider(&no_load_);
error.clear();
- EXPECT_TRUE(policy_.UserMayLoad(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayLoad(nullptr, &error));
EXPECT_TRUE(error.empty());
}
TEST_F(ManagementPolicyTest, UserMayModifySettings) {
// No providers registered.
base::string16 error;
- EXPECT_TRUE(policy_.UserMayModifySettings(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayModifySettings(nullptr, &error));
EXPECT_TRUE(error.empty());
// One provider, no relevant restriction.
policy_.RegisterProvider(&allow_all_);
- EXPECT_TRUE(policy_.UserMayModifySettings(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayModifySettings(nullptr, &error));
EXPECT_TRUE(error.empty());
// Two providers, no relevant restrictions.
policy_.RegisterProvider(&no_load_);
- EXPECT_TRUE(policy_.UserMayModifySettings(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayModifySettings(nullptr, &error));
EXPECT_TRUE(error.empty());
// Three providers, one with a relevant restriction.
policy_.RegisterProvider(&no_modify_status_);
- EXPECT_FALSE(policy_.UserMayModifySettings(NULL, &error));
+ EXPECT_FALSE(policy_.UserMayModifySettings(nullptr, &error));
EXPECT_FALSE(error.empty());
// Remove the restriction.
policy_.UnregisterProvider(&no_modify_status_);
error.clear();
- EXPECT_TRUE(policy_.UserMayModifySettings(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayModifySettings(nullptr, &error));
EXPECT_TRUE(error.empty());
}
TEST_F(ManagementPolicyTest, MustRemainEnabled) {
// No providers registered.
base::string16 error;
- EXPECT_FALSE(policy_.MustRemainEnabled(NULL, &error));
+ EXPECT_FALSE(policy_.MustRemainEnabled(nullptr, &error));
EXPECT_TRUE(error.empty());
// One provider, no relevant restriction.
policy_.RegisterProvider(&allow_all_);
- EXPECT_FALSE(policy_.MustRemainEnabled(NULL, &error));
+ EXPECT_FALSE(policy_.MustRemainEnabled(nullptr, &error));
EXPECT_TRUE(error.empty());
// Two providers, no relevant restrictions.
policy_.RegisterProvider(&no_modify_status_);
- EXPECT_FALSE(policy_.MustRemainEnabled(NULL, &error));
+ EXPECT_FALSE(policy_.MustRemainEnabled(nullptr, &error));
EXPECT_TRUE(error.empty());
// Three providers, one with a relevant restriction.
policy_.RegisterProvider(&must_remain_enabled_);
- EXPECT_TRUE(policy_.MustRemainEnabled(NULL, &error));
+ EXPECT_TRUE(policy_.MustRemainEnabled(nullptr, &error));
EXPECT_FALSE(error.empty());
// Remove the restriction.
policy_.UnregisterProvider(&must_remain_enabled_);
error.clear();
- EXPECT_FALSE(policy_.MustRemainEnabled(NULL, &error));
+ EXPECT_FALSE(policy_.MustRemainEnabled(nullptr, &error));
EXPECT_TRUE(error.empty());
}
TEST_F(ManagementPolicyTest, MustRemainDisabled) {
// No providers registered.
base::string16 error;
- EXPECT_FALSE(policy_.MustRemainDisabled(NULL, NULL, &error));
+ EXPECT_FALSE(policy_.MustRemainDisabled(nullptr, NULL, &error));
EXPECT_TRUE(error.empty());
// One provider, no relevant restriction.
policy_.RegisterProvider(&allow_all_);
- EXPECT_FALSE(policy_.MustRemainDisabled(NULL, NULL, &error));
+ EXPECT_FALSE(policy_.MustRemainDisabled(nullptr, NULL, &error));
EXPECT_TRUE(error.empty());
// Two providers, no relevant restrictions.
policy_.RegisterProvider(&no_modify_status_);
- EXPECT_FALSE(policy_.MustRemainDisabled(NULL, NULL, &error));
+ EXPECT_FALSE(policy_.MustRemainDisabled(nullptr, NULL, &error));
EXPECT_TRUE(error.empty());
// Three providers, one with a relevant restriction.
Extension::DisableReason reason = Extension::DISABLE_NONE;
policy_.RegisterProvider(&must_remain_disabled_);
- EXPECT_TRUE(policy_.MustRemainDisabled(NULL, &reason, &error));
+ EXPECT_TRUE(policy_.MustRemainDisabled(nullptr, &reason, &error));
EXPECT_FALSE(error.empty());
EXPECT_EQ(Extension::DISABLE_SIDELOAD_WIPEOUT, reason);
// Remove the restriction.
policy_.UnregisterProvider(&must_remain_disabled_);
error.clear();
- EXPECT_FALSE(policy_.MustRemainDisabled(NULL, NULL, &error));
+ EXPECT_FALSE(policy_.MustRemainDisabled(nullptr, NULL, &error));
EXPECT_TRUE(error.empty());
}
@@ -182,30 +182,30 @@ TEST_F(ManagementPolicyTest, ErrorHandling) {
std::string original_error = "Ceci est en effet une erreur.";
base::string16 original_error16 = base::UTF8ToUTF16(original_error);
base::string16 error = original_error16;
- EXPECT_TRUE(policy_.UserMayLoad(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayLoad(nullptr, &error));
EXPECT_EQ(original_error, base::UTF16ToUTF8(error));
- EXPECT_TRUE(policy_.UserMayModifySettings(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayModifySettings(nullptr, &error));
EXPECT_EQ(original_error, base::UTF16ToUTF8(error));
- EXPECT_FALSE(policy_.MustRemainEnabled(NULL, &error));
+ EXPECT_FALSE(policy_.MustRemainEnabled(nullptr, &error));
EXPECT_EQ(original_error, base::UTF16ToUTF8(error));
// Ensure no crashes if no error message was requested.
- EXPECT_TRUE(policy_.UserMayLoad(NULL, NULL));
- EXPECT_TRUE(policy_.UserMayModifySettings(NULL, NULL));
- EXPECT_FALSE(policy_.MustRemainEnabled(NULL, NULL));
+ EXPECT_TRUE(policy_.UserMayLoad(nullptr, NULL));
+ EXPECT_TRUE(policy_.UserMayModifySettings(nullptr, NULL));
+ EXPECT_FALSE(policy_.MustRemainEnabled(nullptr, NULL));
policy_.RegisterProvider(&restrict_all_);
- EXPECT_FALSE(policy_.UserMayLoad(NULL, NULL));
- EXPECT_FALSE(policy_.UserMayModifySettings(NULL, NULL));
- EXPECT_TRUE(policy_.MustRemainEnabled(NULL, NULL));
+ EXPECT_FALSE(policy_.UserMayLoad(nullptr, NULL));
+ EXPECT_FALSE(policy_.UserMayModifySettings(nullptr, NULL));
+ EXPECT_TRUE(policy_.MustRemainEnabled(nullptr, NULL));
// Make sure returned error is correct.
error = original_error16;
- EXPECT_FALSE(policy_.UserMayLoad(NULL, &error));
+ EXPECT_FALSE(policy_.UserMayLoad(nullptr, &error));
EXPECT_EQ(base::UTF8ToUTF16(TestProvider::expected_error()), error);
error = original_error16;
- EXPECT_FALSE(policy_.UserMayModifySettings(NULL, &error));
+ EXPECT_FALSE(policy_.UserMayModifySettings(nullptr, &error));
EXPECT_EQ(base::UTF8ToUTF16(TestProvider::expected_error()), error);
error = original_error16;
- EXPECT_TRUE(policy_.MustRemainEnabled(NULL, &error));
+ EXPECT_TRUE(policy_.MustRemainEnabled(nullptr, &error));
EXPECT_EQ(base::UTF8ToUTF16(TestProvider::expected_error()), error);
}

Powered by Google App Engine
This is Rietveld 408576698