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

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

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/browser/policy/browser_policy_connector.h" 10 #include "chrome/browser/policy/browser_policy_connector.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 explicit SigninManagerFake(Profile* profile) 66 explicit SigninManagerFake(Profile* profile)
67 : FakeSigninManager(profile) { 67 : FakeSigninManager(profile) {
68 } 68 }
69 69
70 void ForceSignOut() { 70 void ForceSignOut() {
71 // Allow signing out now. 71 // Allow signing out now.
72 prohibit_signout_ = false; 72 prohibit_signout_ = false;
73 SignOut(); 73 SignOut();
74 } 74 }
75 75
76 static ProfileKeyedService* Build(Profile* profile) { 76 static ProfileKeyedService* Build(content::BrowserContext* profile) {
77 return new SigninManagerFake(profile); 77 return new SigninManagerFake(static_cast<Profile*>(profile));
78 } 78 }
79 }; 79 };
80 } // namespace 80 } // namespace
81 81
82 class UserPolicySigninServiceTest : public testing::Test { 82 class UserPolicySigninServiceTest : public testing::Test {
83 public: 83 public:
84 UserPolicySigninServiceTest() 84 UserPolicySigninServiceTest()
85 : loop_(MessageLoop::TYPE_IO), 85 : loop_(MessageLoop::TYPE_IO),
86 ui_thread_(content::BrowserThread::UI, &loop_), 86 ui_thread_(content::BrowserThread::UI, &loop_),
87 file_thread_(content::BrowserThread::FILE, &loop_), 87 file_thread_(content::BrowserThread::FILE, &loop_),
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 fetch_request->SendResponse(DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED, 701 fetch_request->SendResponse(DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED,
702 em::DeviceManagementResponse()); 702 em::DeviceManagementResponse());
703 base::RunLoop().RunUntilIdle(); 703 base::RunLoop().RunUntilIdle();
704 EXPECT_FALSE(manager_->IsClientRegistered()); 704 EXPECT_FALSE(manager_->IsClientRegistered());
705 EXPECT_FALSE(signin_manager_->IsSignoutProhibited()); 705 EXPECT_FALSE(signin_manager_->IsSignoutProhibited());
706 } 706 }
707 707
708 } // namespace 708 } // namespace
709 709
710 } // namespace policy 710 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698