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

Side by Side Diff: chrome/browser/policy/cloud_policy_subsystem_unittest.cc

Issue 8499021: UserPolicyCache only becomes ready after policy has been fetched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 virtual void SetUp() { 110 virtual void SetUp() {
111 prefs_.reset(new TestingPrefService); 111 prefs_.reset(new TestingPrefService);
112 CloudPolicySubsystem::RegisterPrefs(prefs_.get()); 112 CloudPolicySubsystem::RegisterPrefs(prefs_.get());
113 ((TestingBrowserProcess*) g_browser_process)->SetLocalState(prefs_.get()); 113 ((TestingBrowserProcess*) g_browser_process)->SetLocalState(prefs_.get());
114 114
115 logger_.reset(new EventLogger); 115 logger_.reset(new EventLogger);
116 factory_.reset(new TestingPolicyURLFetcherFactory(logger_.get())); 116 factory_.reset(new TestingPolicyURLFetcherFactory(logger_.get()));
117 ASSERT_TRUE(temp_user_data_dir_.CreateUniqueTempDir()); 117 ASSERT_TRUE(temp_user_data_dir_.CreateUniqueTempDir());
118 data_store_.reset(CloudPolicyDataStore::CreateForUserPolicies()); 118 data_store_.reset(CloudPolicyDataStore::CreateForUserPolicies());
119 cache_ = new UserPolicyCache( 119 cache_ = new UserPolicyCache(
120 temp_user_data_dir_.path().AppendASCII("CloudPolicyControllerTest")); 120 temp_user_data_dir_.path().AppendASCII("CloudPolicyControllerTest"),
121 false /* wait_for_policy_fetch */);
121 cloud_policy_subsystem_.reset(new TestingCloudPolicySubsystem( 122 cloud_policy_subsystem_.reset(new TestingCloudPolicySubsystem(
122 data_store_.get(), cache_, 123 data_store_.get(), cache_,
123 kDeviceManagementUrl, logger_.get())); 124 kDeviceManagementUrl, logger_.get()));
124 cloud_policy_subsystem_->CompleteInitialization( 125 cloud_policy_subsystem_->CompleteInitialization(
125 prefs::kDevicePolicyRefreshRate, 0); 126 prefs::kDevicePolicyRefreshRate, 0);
126 } 127 }
127 128
128 virtual void TearDown() { 129 virtual void TearDown() {
129 static_cast<TestingBrowserProcess*>(g_browser_process)->SetLocalState(NULL); 130 static_cast<TestingBrowserProcess*>(g_browser_process)->SetLocalState(NULL);
130 cloud_policy_subsystem_->Shutdown(); 131 cloud_policy_subsystem_->Shutdown();
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 ExecuteTest(); 382 ExecuteTest();
382 VerifyTest("http://www.youtube.com"); 383 VerifyTest("http://www.youtube.com");
383 } 384 }
384 385
385 INSTANTIATE_TEST_CASE_P( 386 INSTANTIATE_TEST_CASE_P(
386 CloudPolicySubsystemPolicyReregisterTestInstance, 387 CloudPolicySubsystemPolicyReregisterTestInstance,
387 CloudPolicySubsystemPolicyReregisterTest, 388 CloudPolicySubsystemPolicyReregisterTest,
388 testing::Values(401, 403, 410)); 389 testing::Values(401, 403, 410));
389 390
390 } // policy 391 } // policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698