OLD | NEW |
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_store.h" | 5 #include "chrome/browser/policy/cloud/user_cloud_policy_store.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 file_thread_(content::BrowserThread::FILE, &loop_), | 42 file_thread_(content::BrowserThread::FILE, &loop_), |
43 profile_(new TestingProfile()) {} | 43 profile_(new TestingProfile()) {} |
44 | 44 |
45 virtual void SetUp() OVERRIDE { | 45 virtual void SetUp() OVERRIDE { |
46 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); | 46 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); |
47 SigninManager* signin = static_cast<SigninManager*>( | 47 SigninManager* signin = static_cast<SigninManager*>( |
48 SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse( | 48 SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse( |
49 profile_.get(), FakeSigninManager::Build)); | 49 profile_.get(), FakeSigninManager::Build)); |
50 profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | 50 profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, |
51 PolicyBuilder::kFakeUsername); | 51 PolicyBuilder::kFakeUsername); |
52 signin->Initialize(profile_.get()); | 52 signin->Initialize(profile_.get(), NULL); |
53 store_.reset(new UserCloudPolicyStore(profile_.get(), policy_file())); | 53 store_.reset(new UserCloudPolicyStore(profile_.get(), policy_file())); |
54 store_->AddObserver(&observer_); | 54 store_->AddObserver(&observer_); |
55 | 55 |
56 policy_.payload().mutable_showhomebutton()->set_value(true); | 56 policy_.payload().mutable_showhomebutton()->set_value(true); |
57 policy_.payload().mutable_syncdisabled()->set_value(true); | 57 policy_.payload().mutable_syncdisabled()->set_value(true); |
58 policy_.Build(); | 58 policy_.Build(); |
59 } | 59 } |
60 | 60 |
61 virtual void TearDown() OVERRIDE { | 61 virtual void TearDown() OVERRIDE { |
62 store_->RemoveObserver(&observer_); | 62 store_->RemoveObserver(&observer_); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 store4->Load(); | 342 store4->Load(); |
343 RunUntilIdle(); | 343 RunUntilIdle(); |
344 | 344 |
345 ASSERT_FALSE(store4->policy()); | 345 ASSERT_FALSE(store4->policy()); |
346 store4->RemoveObserver(&observer_); | 346 store4->RemoveObserver(&observer_); |
347 } | 347 } |
348 | 348 |
349 } // namespace | 349 } // namespace |
350 | 350 |
351 } // namespace policy | 351 } // namespace policy |
OLD | NEW |