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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 static const char kHostedDomainResponse[] = | 58 static const char kHostedDomainResponse[] = |
59 "{" | 59 "{" |
60 " \"hd\": \"test.com\"" | 60 " \"hd\": \"test.com\"" |
61 "}"; | 61 "}"; |
62 | 62 |
63 namespace { | 63 namespace { |
64 class SigninManagerFake : public FakeSigninManager { | 64 class SigninManagerFake : public FakeSigninManager { |
65 public: | 65 public: |
66 explicit SigninManagerFake(Profile* profile) | 66 explicit SigninManagerFake(Profile* profile) |
67 : FakeSigninManager(profile) { | 67 : FakeSigninManager(profile) { |
68 Initialize(profile); | 68 Initialize(profile, NULL); |
69 } | 69 } |
70 | 70 |
71 void ForceSignOut() { | 71 void ForceSignOut() { |
72 // Allow signing out now. | 72 // Allow signing out now. |
73 prohibit_signout_ = false; | 73 prohibit_signout_ = false; |
74 SignOut(); | 74 SignOut(); |
75 } | 75 } |
76 | 76 |
77 static ProfileKeyedService* Build(content::BrowserContext* profile) { | 77 static ProfileKeyedService* Build(content::BrowserContext* profile) { |
78 return new SigninManagerFake(static_cast<Profile*>(profile)); | 78 return new SigninManagerFake(static_cast<Profile*>(profile)); |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 fetch_request->SendResponse(DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED, | 702 fetch_request->SendResponse(DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED, |
703 em::DeviceManagementResponse()); | 703 em::DeviceManagementResponse()); |
704 base::RunLoop().RunUntilIdle(); | 704 base::RunLoop().RunUntilIdle(); |
705 EXPECT_FALSE(manager_->IsClientRegistered()); | 705 EXPECT_FALSE(manager_->IsClientRegistered()); |
706 EXPECT_FALSE(signin_manager_->IsSignoutProhibited()); | 706 EXPECT_FALSE(signin_manager_->IsSignoutProhibited()); |
707 } | 707 } |
708 | 708 |
709 } // namespace | 709 } // namespace |
710 | 710 |
711 } // namespace policy | 711 } // namespace policy |
OLD | NEW |