| 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 "base/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "testing/gmock/include/gmock/gmock.h" | 46 #include "testing/gmock/include/gmock/gmock.h" |
| 47 #include "testing/gtest/include/gtest/gtest.h" | 47 #include "testing/gtest/include/gtest/gtest.h" |
| 48 #include "url/gurl.h" | 48 #include "url/gurl.h" |
| 49 | 49 |
| 50 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
| 51 #include "chrome/browser/chromeos/login/users/user_manager.h" | 51 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 52 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 52 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 53 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 53 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" |
| 54 #include "chromeos/chromeos_paths.h" | 54 #include "chromeos/chromeos_paths.h" |
| 55 #include "chromeos/dbus/cryptohome_client.h" | 55 #include "chromeos/dbus/cryptohome_client.h" |
| 56 #include "chromeos/login/user_names.h" |
| 56 #else | 57 #else |
| 57 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 58 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| 58 #include "chrome/browser/signin/signin_manager_factory.h" | 59 #include "chrome/browser/signin/signin_manager_factory.h" |
| 59 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" | 60 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
| 60 #include "components/signin/core/browser/signin_manager.h" | 61 #include "components/signin/core/browser/signin_manager.h" |
| 61 #endif | 62 #endif |
| 62 | 63 |
| 63 using testing::AnyNumber; | 64 using testing::AnyNumber; |
| 64 using testing::InvokeWithoutArgs; | 65 using testing::InvokeWithoutArgs; |
| 65 using testing::Mock; | 66 using testing::Mock; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 78 | 79 |
| 79 KeyedService* BuildFakeProfileInvalidationProvider( | 80 KeyedService* BuildFakeProfileInvalidationProvider( |
| 80 content::BrowserContext* context) { | 81 content::BrowserContext* context) { |
| 81 return new invalidation::ProfileInvalidationProvider( | 82 return new invalidation::ProfileInvalidationProvider( |
| 82 scoped_ptr<invalidation::InvalidationService>( | 83 scoped_ptr<invalidation::InvalidationService>( |
| 83 new invalidation::FakeInvalidationService)); | 84 new invalidation::FakeInvalidationService)); |
| 84 } | 85 } |
| 85 | 86 |
| 86 const char* GetTestUser() { | 87 const char* GetTestUser() { |
| 87 #if defined(OS_CHROMEOS) | 88 #if defined(OS_CHROMEOS) |
| 88 return chromeos::UserManager::kStubUser; | 89 return chromeos::login::kStubUser; |
| 89 #else | 90 #else |
| 90 return "user@example.com"; | 91 return "user@example.com"; |
| 91 #endif | 92 #endif |
| 92 } | 93 } |
| 93 | 94 |
| 94 std::string GetEmptyPolicy() { | 95 std::string GetEmptyPolicy() { |
| 95 const char kEmptyPolicy[] = | 96 const char kEmptyPolicy[] = |
| 96 "{" | 97 "{" |
| 97 " \"%s\": {" | 98 " \"%s\": {" |
| 98 " \"mandatory\": {}," | 99 " \"mandatory\": {}," |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 459 |
| 459 // They should now serialize to the same bytes. | 460 // They should now serialize to the same bytes. |
| 460 std::string chrome_settings_serialized; | 461 std::string chrome_settings_serialized; |
| 461 std::string cloud_policy_serialized; | 462 std::string cloud_policy_serialized; |
| 462 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); | 463 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); |
| 463 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); | 464 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); |
| 464 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); | 465 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); |
| 465 } | 466 } |
| 466 | 467 |
| 467 } // namespace policy | 468 } // namespace policy |
| OLD | NEW |