| 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/chromeos/settings/session_manager_operation.h" | 5 #include "chrome/browser/chromeos/settings/session_manager_operation.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 using testing::_; | 40 using testing::_; |
| 41 | 41 |
| 42 namespace chromeos { | 42 namespace chromeos { |
| 43 | 43 |
| 44 class SessionManagerOperationTest : public testing::Test { | 44 class SessionManagerOperationTest : public testing::Test { |
| 45 public: | 45 public: |
| 46 SessionManagerOperationTest() | 46 SessionManagerOperationTest() |
| 47 : ui_thread_(content::BrowserThread::UI, &message_loop_), | 47 : ui_thread_(content::BrowserThread::UI, &message_loop_), |
| 48 file_thread_(content::BrowserThread::FILE, &message_loop_), | 48 file_thread_(content::BrowserThread::FILE, &message_loop_), |
| 49 owner_key_util_(new ownership::MockOwnerKeyUtil()), | 49 owner_key_util_(new ownership::MockOwnerKeyUtil()), |
| 50 user_manager_(new user_manager::FakeUserManager()), | 50 user_manager_(new chromeos::FakeChromeUserManager()), |
| 51 user_manager_enabler_(user_manager_), | 51 user_manager_enabler_(user_manager_), |
| 52 validated_(false) { | 52 validated_(false) { |
| 53 OwnerSettingsServiceChromeOSFactory::GetInstance() | 53 OwnerSettingsServiceChromeOSFactory::GetInstance() |
| 54 ->SetOwnerKeyUtilForTesting(owner_key_util_); | 54 ->SetOwnerKeyUtilForTesting(owner_key_util_); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void SetUp() override { | 57 void SetUp() override { |
| 58 policy_.payload().mutable_user_whitelist()->add_user_whitelist( | 58 policy_.payload().mutable_user_whitelist()->add_user_whitelist( |
| 59 "fake-whitelist"); | 59 "fake-whitelist"); |
| 60 policy_.Build(); | 60 policy_.Build(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 base::MessageLoop message_loop_; | 88 base::MessageLoop message_loop_; |
| 89 content::TestBrowserThread ui_thread_; | 89 content::TestBrowserThread ui_thread_; |
| 90 content::TestBrowserThread file_thread_; | 90 content::TestBrowserThread file_thread_; |
| 91 | 91 |
| 92 policy::DevicePolicyBuilder policy_; | 92 policy::DevicePolicyBuilder policy_; |
| 93 DeviceSettingsTestHelper device_settings_test_helper_; | 93 DeviceSettingsTestHelper device_settings_test_helper_; |
| 94 scoped_refptr<ownership::MockOwnerKeyUtil> owner_key_util_; | 94 scoped_refptr<ownership::MockOwnerKeyUtil> owner_key_util_; |
| 95 | 95 |
| 96 user_manager::FakeUserManager* user_manager_; | 96 chromeos::FakeChromeUserManager* user_manager_; |
| 97 ScopedUserManagerEnabler user_manager_enabler_; | 97 ScopedUserManagerEnabler user_manager_enabler_; |
| 98 | 98 |
| 99 std::unique_ptr<TestingProfile> profile_; | 99 std::unique_ptr<TestingProfile> profile_; |
| 100 OwnerSettingsServiceChromeOS* service_; | 100 OwnerSettingsServiceChromeOS* service_; |
| 101 | 101 |
| 102 bool validated_; | 102 bool validated_; |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 DISALLOW_COPY_AND_ASSIGN(SessionManagerOperationTest); | 105 DISALLOW_COPY_AND_ASSIGN(SessionManagerOperationTest); |
| 106 }; | 106 }; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 policy_.GetBlob()); | 224 policy_.GetBlob()); |
| 225 ASSERT_TRUE(op.policy_data().get()); | 225 ASSERT_TRUE(op.policy_data().get()); |
| 226 EXPECT_EQ(policy_.policy_data().SerializeAsString(), | 226 EXPECT_EQ(policy_.policy_data().SerializeAsString(), |
| 227 op.policy_data()->SerializeAsString()); | 227 op.policy_data()->SerializeAsString()); |
| 228 ASSERT_TRUE(op.device_settings().get()); | 228 ASSERT_TRUE(op.device_settings().get()); |
| 229 EXPECT_EQ(policy_.payload().SerializeAsString(), | 229 EXPECT_EQ(policy_.payload().SerializeAsString(), |
| 230 op.device_settings()->SerializeAsString()); | 230 op.device_settings()->SerializeAsString()); |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace chromeos | 233 } // namespace chromeos |
| OLD | NEW |