OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/policy/consumer_management_service.h" | 5 #include "chrome/browser/chromeos/policy/consumer_management_service.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/callback.h" | 9 #include "base/callback.h" |
10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
26 | 26 |
27 using testing::Invoke; | 27 using testing::Invoke; |
28 using testing::NiceMock; | 28 using testing::NiceMock; |
29 using testing::_; | 29 using testing::_; |
30 | 30 |
31 namespace em = enterprise_management; | 31 namespace em = enterprise_management; |
32 | 32 |
33 namespace { | 33 namespace { |
34 const char* kAttributeOwnerId = "consumer_management.owner_id"; | 34 const char kAttributeOwnerId[] = "consumer_management.owner_id"; |
35 const char* kTestOwner = "test@chromium.org.test"; | 35 const char kTestOwner[] = "test@chromium.org.test"; |
36 } | 36 } |
37 | 37 |
38 namespace policy { | 38 namespace policy { |
39 | 39 |
40 class ConsumerManagementServiceTest : public BrowserWithTestWindowTest { | 40 class ConsumerManagementServiceTest : public BrowserWithTestWindowTest { |
41 public: | 41 public: |
42 ConsumerManagementServiceTest() | 42 ConsumerManagementServiceTest() |
43 : cryptohome_result_(false), | 43 : cryptohome_result_(false), |
44 set_owner_status_(false) { | 44 set_owner_status_(false) { |
45 ON_CALL(mock_cryptohome_client_, GetBootAttribute(_, _)) | 45 ON_CALL(mock_cryptohome_client_, GetBootAttribute(_, _)) |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 EXPECT_EQ(ConsumerManagementService::STATUS_ENROLLED, service_.GetStatus()); | 243 EXPECT_EQ(ConsumerManagementService::STATUS_ENROLLED, service_.GetStatus()); |
244 EXPECT_EQ("StatusEnrolled", service_.GetStatusString()); | 244 EXPECT_EQ("StatusEnrolled", service_.GetStatusString()); |
245 EXPECT_TRUE(service_.HasPendingEnrollmentNotification()); | 245 EXPECT_TRUE(service_.HasPendingEnrollmentNotification()); |
246 | 246 |
247 // TODO(davidyu): Test for STATUS_UNENROLLING when it is implemented. | 247 // TODO(davidyu): Test for STATUS_UNENROLLING when it is implemented. |
248 // http://crbug.com/353050. | 248 // http://crbug.com/353050. |
249 } | 249 } |
250 | 250 |
251 } // namespace policy | 251 } // namespace policy |
OLD | NEW |