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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |