| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "testing/gmock/include/gmock/gmock.h" | 51 #include "testing/gmock/include/gmock/gmock.h" |
| 52 #include "testing/gtest/include/gtest/gtest.h" | 52 #include "testing/gtest/include/gtest/gtest.h" |
| 53 #include "url/gurl.h" | 53 #include "url/gurl.h" |
| 54 | 54 |
| 55 #if defined(OS_CHROMEOS) | 55 #if defined(OS_CHROMEOS) |
| 56 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 56 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 57 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 57 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" |
| 58 #include "chromeos/chromeos_paths.h" | 58 #include "chromeos/chromeos_paths.h" |
| 59 #include "chromeos/cryptohome/cryptohome_parameters.h" | 59 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 60 #include "chromeos/dbus/cryptohome_client.h" | 60 #include "chromeos/dbus/cryptohome_client.h" |
| 61 #include "chromeos/login/user_names.h" | |
| 62 #include "components/signin/core/account_id/account_id.h" | 61 #include "components/signin/core/account_id/account_id.h" |
| 62 #include "components/user_manager/user_names.h" |
| 63 #else | 63 #else |
| 64 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 64 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| 65 #include "chrome/browser/signin/signin_manager_factory.h" | 65 #include "chrome/browser/signin/signin_manager_factory.h" |
| 66 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | 66 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
| 67 #include "components/signin/core/browser/signin_manager.h" | 67 #include "components/signin/core/browser/signin_manager.h" |
| 68 #endif | 68 #endif |
| 69 | 69 |
| 70 using testing::AnyNumber; | 70 using testing::AnyNumber; |
| 71 using testing::InvokeWithoutArgs; | 71 using testing::InvokeWithoutArgs; |
| 72 using testing::Mock; | 72 using testing::Mock; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 #if !defined(OS_CHROMEOS) | 93 #if !defined(OS_CHROMEOS) |
| 94 const char* GetTestGaiaId() { | 94 const char* GetTestGaiaId() { |
| 95 return "gaia-id-user@example.com"; | 95 return "gaia-id-user@example.com"; |
| 96 } | 96 } |
| 97 #endif | 97 #endif |
| 98 | 98 |
| 99 const char* GetTestUser() { | 99 const char* GetTestUser() { |
| 100 #if defined(OS_CHROMEOS) | 100 #if defined(OS_CHROMEOS) |
| 101 return chromeos::login::kStubUser; | 101 return user_manager::kStubUser; |
| 102 #else | 102 #else |
| 103 return "user@example.com"; | 103 return "user@example.com"; |
| 104 #endif | 104 #endif |
| 105 } | 105 } |
| 106 | 106 |
| 107 std::string GetEmptyPolicy() { | 107 std::string GetEmptyPolicy() { |
| 108 const char kEmptyPolicy[] = | 108 const char kEmptyPolicy[] = |
| 109 "{" | 109 "{" |
| 110 " \"%s\": {" | 110 " \"%s\": {" |
| 111 " \"mandatory\": {}," | 111 " \"mandatory\": {}," |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 494 |
| 495 // They should now serialize to the same bytes. | 495 // They should now serialize to the same bytes. |
| 496 std::string chrome_settings_serialized; | 496 std::string chrome_settings_serialized; |
| 497 std::string cloud_policy_serialized; | 497 std::string cloud_policy_serialized; |
| 498 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 498 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
| 499 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 499 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
| 500 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 500 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
| 501 } | 501 } |
| 502 | 502 |
| 503 } // namespace policy | 503 } // namespace policy |
| OLD | NEW |