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

Unified Diff: extensions/browser/management_policy_unittest.cc

Issue 384423002: [Canceled] Extensions: Add install_flags parameter to ManagementPolicy::UserMayLoad (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update tests Created 6 years, 5 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/management_policy.cc ('k') | extensions/browser/test_management_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7946f7ef4a6657521d7a79c22f20c919c5e01be4 100644
--- a/extensions/browser/management_policy_unittest.cc
+++ b/extensions/browser/management_policy_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/strings/utf_string_conversions.h"
+#include "extensions/browser/install_flag.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/test_management_policy.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -10,6 +11,8 @@
typedef extensions::TestManagementPolicyProvider TestProvider;
using extensions::Extension;
+const int kInstallFlags = extensions::kInstallFlagNone;
+
class ManagementPolicyTest : public testing::Test {
public:
virtual void SetUp() {
@@ -66,28 +69,28 @@ 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(NULL, kInstallFlags, &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(NULL, kInstallFlags, &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(NULL, kInstallFlags, &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(NULL, kInstallFlags, &error));
EXPECT_FALSE(error.empty());
// Remove the restriction.
policy_.UnregisterProvider(&no_load_);
error.clear();
- EXPECT_TRUE(policy_.UserMayLoad(NULL, &error));
+ EXPECT_TRUE(policy_.UserMayLoad(NULL, kInstallFlags, &error));
EXPECT_TRUE(error.empty());
}
TEST_F(ManagementPolicyTest, UserMayModifySettings) {
@@ -182,7 +185,7 @@ 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(NULL, kInstallFlags, &error));
EXPECT_EQ(original_error, base::UTF16ToUTF8(error));
EXPECT_TRUE(policy_.UserMayModifySettings(NULL, &error));
EXPECT_EQ(original_error, base::UTF16ToUTF8(error));
@@ -190,17 +193,17 @@ TEST_F(ManagementPolicyTest, ErrorHandling) {
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_.UserMayLoad(NULL, kInstallFlags, NULL));
EXPECT_TRUE(policy_.UserMayModifySettings(NULL, NULL));
EXPECT_FALSE(policy_.MustRemainEnabled(NULL, NULL));
policy_.RegisterProvider(&restrict_all_);
- EXPECT_FALSE(policy_.UserMayLoad(NULL, NULL));
+ EXPECT_FALSE(policy_.UserMayLoad(NULL, kInstallFlags, NULL));
EXPECT_FALSE(policy_.UserMayModifySettings(NULL, NULL));
EXPECT_TRUE(policy_.MustRemainEnabled(NULL, NULL));
// Make sure returned error is correct.
error = original_error16;
- EXPECT_FALSE(policy_.UserMayLoad(NULL, &error));
+ EXPECT_FALSE(policy_.UserMayLoad(NULL, kInstallFlags, &error));
EXPECT_EQ(base::UTF8ToUTF16(TestProvider::expected_error()), error);
error = original_error16;
EXPECT_FALSE(policy_.UserMayModifySettings(NULL, &error));
« no previous file with comments | « extensions/browser/management_policy.cc ('k') | extensions/browser/test_management_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698