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

Side by Side Diff: trunk/src/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc

Issue 17068004: Revert 207755 "Add device policies to control accessibility sett..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 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/chromeos/policy/user_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/prefs/pref_registry_simple.h" 12 #include "base/prefs/pref_registry_simple.h"
13 #include "base/prefs/testing_pref_service.h" 13 #include "base/prefs/testing_pref_service.h"
14 #include "base/run_loop.h" 14 #include "base/run_loop.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h" 17 #include "chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h"
18 #include "chrome/browser/chromeos/profiles/profile_helper.h" 18 #include "chrome/browser/chromeos/profiles/profile_helper.h"
19 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" 19 #include "chrome/browser/policy/cloud/cloud_policy_constants.h"
20 #include "chrome/browser/policy/cloud/cloud_policy_service.h" 20 #include "chrome/browser/policy/cloud/cloud_policy_service.h"
21 #include "chrome/browser/policy/cloud/mock_cloud_policy_store.h" 21 #include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
22 #include "chrome/browser/policy/cloud/mock_device_management_service.h" 22 #include "chrome/browser/policy/cloud/mock_device_management_service.h"
23 #include "chrome/browser/policy/cloud/resource_cache.h" 23 #include "chrome/browser/policy/cloud/resource_cache.h"
24 #include "chrome/browser/policy/mock_configuration_policy_provider.h" 24 #include "chrome/browser/policy/mock_configuration_policy_provider.h"
25 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" 25 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
26 #include "chrome/browser/prefs/browser_prefs.h" 26 #include "chrome/browser/prefs/browser_prefs.h"
27 #include "chrome/browser/prefs/pref_service_syncable.h"
28 #include "chrome/browser/signin/token_service.h" 27 #include "chrome/browser/signin/token_service.h"
29 #include "chrome/browser/signin/token_service_factory.h" 28 #include "chrome/browser/signin/token_service_factory.h"
30 #include "chrome/common/chrome_constants.h" 29 #include "chrome/common/chrome_constants.h"
31 #include "chrome/test/base/testing_browser_process.h" 30 #include "chrome/test/base/testing_browser_process.h"
32 #include "chrome/test/base/testing_profile.h" 31 #include "chrome/test/base/testing_profile.h"
33 #include "chrome/test/base/testing_profile_manager.h" 32 #include "chrome/test/base/testing_profile_manager.h"
34 #include "content/public/test/test_browser_thread.h" 33 #include "content/public/test/test_browser_thread.h"
35 #include "google_apis/gaia/gaia_auth_consumer.h" 34 #include "google_apis/gaia/gaia_auth_consumer.h"
36 #include "google_apis/gaia/gaia_urls.h" 35 #include "google_apis/gaia/gaia_urls.h"
37 #include "net/url_request/test_url_fetcher_factory.h" 36 #include "net/url_request/test_url_fetcher_factory.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 profile_(NULL), 78 profile_(NULL),
80 signin_profile_(NULL) {} 79 signin_profile_(NULL) {}
81 80
82 virtual void SetUp() OVERRIDE { 81 virtual void SetUp() OVERRIDE {
83 // The initialization path that blocks on the initial policy fetch requires 82 // The initialization path that blocks on the initial policy fetch requires
84 // a signin Profile to use its URLRequestContext. 83 // a signin Profile to use its URLRequestContext.
85 profile_manager_.reset( 84 profile_manager_.reset(
86 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); 85 new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
87 ASSERT_TRUE(profile_manager_->SetUp()); 86 ASSERT_TRUE(profile_manager_->SetUp());
88 profile_ = profile_manager_->CreateTestingProfile( 87 profile_ = profile_manager_->CreateTestingProfile(
89 chrome::kInitialProfile, scoped_ptr<PrefServiceSyncable>(), 88 chrome::kInitialProfile, UTF8ToUTF16("testing_profile"), 0);
90 UTF8ToUTF16("testing_profile"), 0);
91 signin_profile_ = profile_manager_->CreateTestingProfile("signin_profile"); 89 signin_profile_ = profile_manager_->CreateTestingProfile("signin_profile");
92 signin_profile_->set_incognito(true); 90 signin_profile_->set_incognito(true);
93 // Usually the signin Profile and the main Profile are separate, but since 91 // Usually the signin Profile and the main Profile are separate, but since
94 // the signin Profile is an OTR Profile then for this test it suffices to 92 // the signin Profile is an OTR Profile then for this test it suffices to
95 // attach it to the main Profile. 93 // attach it to the main Profile.
96 profile_->SetOffTheRecordProfile(signin_profile_); 94 profile_->SetOffTheRecordProfile(signin_profile_);
97 signin_profile_->SetOriginalProfile(profile_); 95 signin_profile_->SetOriginalProfile(profile_);
98 signin_profile_->CreateRequestContext(); 96 signin_profile_->CreateRequestContext();
99 ASSERT_EQ(signin_profile_, chromeos::ProfileHelper::GetSigninProfile()); 97 ASSERT_EQ(signin_profile_, chromeos::ProfileHelper::GetSigninProfile());
100 98
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 506
509 // The refresh scheduler takes care of the initial fetch for unmanaged users. 507 // The refresh scheduler takes care of the initial fetch for unmanaged users.
510 // It posts a delayed task with 0ms delay in this case, so spinning the loop 508 // It posts a delayed task with 0ms delay in this case, so spinning the loop
511 // issues the initial fetch. 509 // issues the initial fetch.
512 base::RunLoop loop; 510 base::RunLoop loop;
513 FetchPolicy( 511 FetchPolicy(
514 base::Bind(&base::RunLoop::RunUntilIdle, base::Unretained(&loop))); 512 base::Bind(&base::RunLoop::RunUntilIdle, base::Unretained(&loop)));
515 } 513 }
516 514
517 } // namespace policy 515 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698