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

Side by Side Diff: chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" 5 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/policy/cloud/mock_user_cloud_policy_store.h" 10 #include "chrome/browser/policy/cloud/mock_user_cloud_policy_store.h"
(...skipping 21 matching lines...) Expand all
32 policy_map_.Set("key", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 32 policy_map_.Set("key", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
33 base::Value::CreateStringValue("value")); 33 base::Value::CreateStringValue("value"));
34 expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) 34 expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
35 .CopyFrom(policy_map_); 35 .CopyFrom(policy_map_);
36 } 36 }
37 37
38 virtual void TearDown() OVERRIDE { 38 virtual void TearDown() OVERRIDE {
39 if (manager_) { 39 if (manager_) {
40 manager_->RemoveObserver(&observer_); 40 manager_->RemoveObserver(&observer_);
41 manager_->CloudPolicyManager::Shutdown(); 41 manager_->CloudPolicyManager::Shutdown();
42 manager_->ProfileKeyedService::Shutdown(); 42 manager_->BrowserContextKeyedService::Shutdown();
43 } 43 }
44 } 44 }
45 45
46 void CreateManager() { 46 void CreateManager() {
47 store_ = new MockUserCloudPolicyStore(); 47 store_ = new MockUserCloudPolicyStore();
48 EXPECT_CALL(*store_, Load()); 48 EXPECT_CALL(*store_, Load());
49 manager_.reset( 49 manager_.reset(
50 new UserCloudPolicyManager(NULL, 50 new UserCloudPolicyManager(NULL,
51 scoped_ptr<UserCloudPolicyStore>(store_))); 51 scoped_ptr<UserCloudPolicyStore>(store_)));
52 manager_->Init(); 52 manager_->Init();
(...skipping 26 matching lines...) Expand all
79 store_->NotifyStoreLoaded(); 79 store_->NotifyStoreLoaded();
80 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies())); 80 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies()));
81 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); 81 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME));
82 EXPECT_CALL(*store_, Clear()); 82 EXPECT_CALL(*store_, Clear());
83 manager_->DisconnectAndRemovePolicy(); 83 manager_->DisconnectAndRemovePolicy();
84 EXPECT_FALSE(manager_->core()->service()); 84 EXPECT_FALSE(manager_->core()->service());
85 } 85 }
86 86
87 } // namespace 87 } // namespace
88 } // namespace policy 88 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698