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 18 matching lines...) Expand all Loading... |
29 "\x6f\x02\x4a\xd7\xeb\x92\x45\xfc\xd4\xe4\x37\xa1\x55\x2b\x13\x8a"; | 29 "\x6f\x02\x4a\xd7\xeb\x92\x45\xfc\xd4\xe4\x37\xa1\x55\x2b\x13\x8a"; |
30 | 30 |
31 using ::testing::InSequence; | 31 using ::testing::InSequence; |
32 using ::testing::SaveArg; | 32 using ::testing::SaveArg; |
33 using ::testing::_; | 33 using ::testing::_; |
34 | 34 |
35 class AutoEnrollmentClientTest : public testing::Test { | 35 class AutoEnrollmentClientTest : public testing::Test { |
36 protected: | 36 protected: |
37 AutoEnrollmentClientTest() | 37 AutoEnrollmentClientTest() |
38 : scoped_testing_local_state_( | 38 : scoped_testing_local_state_( |
39 static_cast<TestingBrowserProcess*>(g_browser_process)), | 39 TestingBrowserProcess::GetGlobal()), |
40 local_state_(scoped_testing_local_state_.Get()), | 40 local_state_(scoped_testing_local_state_.Get()), |
41 service_(NULL), | 41 service_(NULL), |
42 completion_callback_count_(0) {} | 42 completion_callback_count_(0) {} |
43 | 43 |
44 virtual void SetUp() OVERRIDE { | 44 virtual void SetUp() OVERRIDE { |
45 CreateClient(kSerial, 4, 8); | 45 CreateClient(kSerial, 4, 8); |
46 ASSERT_FALSE(local_state_->GetUserPref(prefs::kShouldAutoEnroll)); | 46 ASSERT_FALSE(local_state_->GetUserPref(prefs::kShouldAutoEnroll)); |
47 ASSERT_FALSE(local_state_->GetUserPref(prefs::kAutoEnrollmentPowerLimit)); | 47 ASSERT_FALSE(local_state_->GetUserPref(prefs::kAutoEnrollmentPowerLimit)); |
48 } | 48 } |
49 | 49 |
(...skipping 265 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 |