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

Unified Diff: components/sync_driver/sync_policy_handler_unittest.cc

Issue 2203673002: [Sync] Move //components/sync_driver to //components/sync/driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sd-a
Patch Set: Full change rebased on static lib. Created 4 years, 4 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 | « components/sync_driver/sync_policy_handler.cc ('k') | components/sync_driver/sync_prefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_driver/sync_policy_handler_unittest.cc
diff --git a/components/sync_driver/sync_policy_handler_unittest.cc b/components/sync_driver/sync_policy_handler_unittest.cc
deleted file mode 100644
index b3754cb82bac7d12134ec6a561b5c0f74532f676..0000000000000000000000000000000000000000
--- a/components/sync_driver/sync_policy_handler_unittest.cc
+++ /dev/null
@@ -1,61 +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 "components/sync_driver/sync_policy_handler.h"
-
-#include "base/memory/ptr_util.h"
-#include "base/values.h"
-#include "components/policy/core/common/policy_map.h"
-#include "components/policy/core/common/policy_types.h"
-#include "components/prefs/pref_value_map.h"
-#include "components/sync_driver/pref_names.h"
-#include "policy/policy_constants.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace sync_driver {
-
-// Test cases for the Sync policy setting.
-class SyncPolicyHandlerTest : public testing::Test {};
-
-TEST_F(SyncPolicyHandlerTest, Default) {
- policy::PolicyMap policy;
- SyncPolicyHandler handler;
- PrefValueMap prefs;
- handler.ApplyPolicySettings(policy, &prefs);
- EXPECT_FALSE(prefs.GetValue(sync_driver::prefs::kSyncManaged, NULL));
-}
-
-TEST_F(SyncPolicyHandlerTest, Enabled) {
- policy::PolicyMap policy;
- policy.Set(policy::key::kSyncDisabled, policy::POLICY_LEVEL_MANDATORY,
- policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
- base::WrapUnique(new base::FundamentalValue(false)), nullptr);
- SyncPolicyHandler handler;
- PrefValueMap prefs;
- handler.ApplyPolicySettings(policy, &prefs);
-
- // Enabling Sync should not set the pref.
- EXPECT_FALSE(prefs.GetValue(sync_driver::prefs::kSyncManaged, NULL));
-}
-
-TEST_F(SyncPolicyHandlerTest, Disabled) {
- policy::PolicyMap policy;
- policy.Set(policy::key::kSyncDisabled, policy::POLICY_LEVEL_MANDATORY,
- policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
- base::WrapUnique(new base::FundamentalValue(true)), nullptr);
- SyncPolicyHandler handler;
- PrefValueMap prefs;
- handler.ApplyPolicySettings(policy, &prefs);
-
- // Sync should be flagged as managed.
- const base::Value* value = NULL;
- EXPECT_TRUE(prefs.GetValue(sync_driver::prefs::kSyncManaged, &value));
- ASSERT_TRUE(value);
- bool sync_managed = false;
- bool result = value->GetAsBoolean(&sync_managed);
- ASSERT_TRUE(result);
- EXPECT_TRUE(sync_managed);
-}
-
-} // namespace sync_driver
« no previous file with comments | « components/sync_driver/sync_policy_handler.cc ('k') | components/sync_driver/sync_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698