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

Unified Diff: chrome/browser/policy/autofill_policy_handler_unittest.cc

Issue 140803003: Move the Autofill and URLBlacklist policy handlers to the component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trying again... Created 6 years, 11 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: chrome/browser/policy/autofill_policy_handler_unittest.cc
diff --git a/chrome/browser/policy/autofill_policy_handler_unittest.cc b/chrome/browser/policy/autofill_policy_handler_unittest.cc
deleted file mode 100644
index a3aeb3cc41351c7b3c18ca7215f3bac6b9726e85..0000000000000000000000000000000000000000
--- a/chrome/browser/policy/autofill_policy_handler_unittest.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/prefs/pref_value_map.h"
-#include "base/values.h"
-#include "chrome/browser/policy/autofill_policy_handler.h"
-#include "components/autofill/core/common/autofill_pref_names.h"
-#include "components/policy/core/common/policy_map.h"
-#include "policy/policy_constants.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace policy {
-
-// Test cases for the Autofill policy setting.
-class AutofillPolicyHandlerTest : public testing::Test {};
-
-TEST_F(AutofillPolicyHandlerTest, Default) {
- PolicyMap policy;
- PrefValueMap prefs;
- AutofillPolicyHandler handler;
- handler.ApplyPolicySettings(policy, &prefs);
- EXPECT_FALSE(prefs.GetValue(autofill::prefs::kAutofillEnabled, NULL));
-}
-
-TEST_F(AutofillPolicyHandlerTest, Enabled) {
- PolicyMap policy;
- policy.Set(key::kAutoFillEnabled,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
- base::Value::CreateBooleanValue(true),
- NULL);
- PrefValueMap prefs;
- AutofillPolicyHandler handler;
- handler.ApplyPolicySettings(policy, &prefs);
-
- // Enabling Autofill should not set the pref.
- EXPECT_FALSE(prefs.GetValue(autofill::prefs::kAutofillEnabled, NULL));
-}
-
-TEST_F(AutofillPolicyHandlerTest, Disabled) {
- PolicyMap policy;
- policy.Set(key::kAutoFillEnabled,
- POLICY_LEVEL_MANDATORY,
- POLICY_SCOPE_USER,
- base::Value::CreateBooleanValue(false),
- NULL);
- PrefValueMap prefs;
- AutofillPolicyHandler handler;
- handler.ApplyPolicySettings(policy, &prefs);
-
- // Disabling Autofill should switch the pref to managed.
- const base::Value* value = NULL;
- EXPECT_TRUE(prefs.GetValue(autofill::prefs::kAutofillEnabled, &value));
- ASSERT_TRUE(value);
- bool autofill_enabled = true;
- bool result = value->GetAsBoolean(&autofill_enabled);
- ASSERT_TRUE(result);
- EXPECT_FALSE(autofill_enabled);
-}
-
-} // namespace policy
« no previous file with comments | « chrome/browser/policy/autofill_policy_handler.cc ('k') | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698