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 "chrome/browser/policy/auto_enrollment_client.h" | 5 #include "chrome/browser/policy/auto_enrollment_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 EXPECT_TRUE(Value::Equals( | 107 EXPECT_TRUE(Value::Equals( |
108 &value_power_limit, | 108 &value_power_limit, |
109 local_state_->GetUserPref(prefs::kAutoEnrollmentPowerLimit))); | 109 local_state_->GetUserPref(prefs::kAutoEnrollmentPowerLimit))); |
110 } | 110 } |
111 | 111 |
112 const em::DeviceAutoEnrollmentRequest& auto_enrollment_request() { | 112 const em::DeviceAutoEnrollmentRequest& auto_enrollment_request() { |
113 return last_request_.auto_enrollment_request(); | 113 return last_request_.auto_enrollment_request(); |
114 } | 114 } |
115 | 115 |
116 ScopedTestingLocalState scoped_testing_local_state_; | 116 ScopedTestingLocalState scoped_testing_local_state_; |
117 TestingPrefService* local_state_; | 117 TestingPrefServiceSimple* local_state_; |
118 MockDeviceManagementService* service_; | 118 MockDeviceManagementService* service_; |
119 scoped_ptr<AutoEnrollmentClient> client_; | 119 scoped_ptr<AutoEnrollmentClient> client_; |
120 em::DeviceManagementRequest last_request_; | 120 em::DeviceManagementRequest last_request_; |
121 int completion_callback_count_; | 121 int completion_callback_count_; |
122 | 122 |
123 private: | 123 private: |
124 DISALLOW_COPY_AND_ASSIGN(AutoEnrollmentClientTest); | 124 DISALLOW_COPY_AND_ASSIGN(AutoEnrollmentClientTest); |
125 }; | 125 }; |
126 | 126 |
127 TEST_F(AutoEnrollmentClientTest, NetworkFailure) { | 127 TEST_F(AutoEnrollmentClientTest, NetworkFailure) { |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 CreateClient(kSerial, 5, 10); | 315 CreateClient(kSerial, 5, 10); |
316 ServerWillReply(-1, true, true); | 316 ServerWillReply(-1, true, true); |
317 client_->Start(); | 317 client_->Start(); |
318 EXPECT_TRUE(client_->should_auto_enroll()); | 318 EXPECT_TRUE(client_->should_auto_enroll()); |
319 EXPECT_EQ(1, completion_callback_count_); | 319 EXPECT_EQ(1, completion_callback_count_); |
320 } | 320 } |
321 | 321 |
322 } // namespace | 322 } // namespace |
323 | 323 |
324 } // namespace policy | 324 } // namespace policy |
OLD | NEW |