| 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/policy/user_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
| 28 #include "chrome/test/base/testing_profile_manager.h" | 28 #include "chrome/test/base/testing_profile_manager.h" |
| 29 #include "components/policy/core/common/cloud/cloud_external_data_manager.h" | 29 #include "components/policy/core/common/cloud/cloud_external_data_manager.h" |
| 30 #include "components/policy/core/common/cloud/mock_cloud_external_data_manager.h
" | 30 #include "components/policy/core/common/cloud/mock_cloud_external_data_manager.h
" |
| 31 #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" | 31 #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" |
| 32 #include "components/policy/core/common/cloud/mock_device_management_service.h" | 32 #include "components/policy/core/common/cloud/mock_device_management_service.h" |
| 33 #include "components/policy/core/common/external_data_fetcher.h" | 33 #include "components/policy/core/common/external_data_fetcher.h" |
| 34 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 34 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
| 35 #include "components/policy/core/common/policy_types.h" | 35 #include "components/policy/core/common/policy_types.h" |
| 36 #include "components/policy/core/common/schema_registry.h" | 36 #include "components/policy/core/common/schema_registry.h" |
| 37 #include "components/policy/policy_constants.h" |
| 38 #include "components/policy/proto/device_management_backend.pb.h" |
| 37 #include "components/prefs/pref_registry_simple.h" | 39 #include "components/prefs/pref_registry_simple.h" |
| 38 #include "components/prefs/testing_pref_service.h" | 40 #include "components/prefs/testing_pref_service.h" |
| 39 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" | 41 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" |
| 40 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 42 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 41 #include "components/signin/core/browser/signin_manager.h" | 43 #include "components/signin/core/browser/signin_manager.h" |
| 42 #include "components/syncable_prefs/pref_service_syncable.h" | 44 #include "components/syncable_prefs/pref_service_syncable.h" |
| 43 #include "components/user_manager/fake_user_manager.h" | 45 #include "components/user_manager/fake_user_manager.h" |
| 44 #include "content/public/test/test_browser_thread_bundle.h" | 46 #include "content/public/test/test_browser_thread_bundle.h" |
| 45 #include "google_apis/gaia/gaia_auth_consumer.h" | 47 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 46 #include "google_apis/gaia/gaia_constants.h" | 48 #include "google_apis/gaia/gaia_constants.h" |
| 47 #include "google_apis/gaia/gaia_urls.h" | 49 #include "google_apis/gaia/gaia_urls.h" |
| 48 #include "net/http/http_response_headers.h" | 50 #include "net/http/http_response_headers.h" |
| 49 #include "net/url_request/test_url_fetcher_factory.h" | 51 #include "net/url_request/test_url_fetcher_factory.h" |
| 50 #include "net/url_request/url_fetcher_delegate.h" | 52 #include "net/url_request/url_fetcher_delegate.h" |
| 51 #include "net/url_request/url_request_context_getter.h" | 53 #include "net/url_request/url_request_context_getter.h" |
| 52 #include "net/url_request/url_request_status.h" | 54 #include "net/url_request/url_request_status.h" |
| 53 #include "policy/policy_constants.h" | |
| 54 #include "policy/proto/device_management_backend.pb.h" | |
| 55 #include "testing/gmock/include/gmock/gmock.h" | 55 #include "testing/gmock/include/gmock/gmock.h" |
| 56 #include "testing/gtest/include/gtest/gtest.h" | 56 #include "testing/gtest/include/gtest/gtest.h" |
| 57 | 57 |
| 58 namespace em = enterprise_management; | 58 namespace em = enterprise_management; |
| 59 | 59 |
| 60 using testing::AnyNumber; | 60 using testing::AnyNumber; |
| 61 using testing::AtLeast; | 61 using testing::AtLeast; |
| 62 using testing::Mock; | 62 using testing::Mock; |
| 63 using testing::_; | 63 using testing::_; |
| 64 | 64 |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); | 601 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); |
| 602 EXPECT_TRUE(manager_->core()->client()->is_registered()); | 602 EXPECT_TRUE(manager_->core()->client()->is_registered()); |
| 603 | 603 |
| 604 // The refresh scheduler takes care of the initial fetch for unmanaged users. | 604 // The refresh scheduler takes care of the initial fetch for unmanaged users. |
| 605 // Running the task runner issues the initial fetch. | 605 // Running the task runner issues the initial fetch. |
| 606 FetchPolicy( | 606 FetchPolicy( |
| 607 base::Bind(&base::TestSimpleTaskRunner::RunUntilIdle, task_runner_)); | 607 base::Bind(&base::TestSimpleTaskRunner::RunUntilIdle, task_runner_)); |
| 608 } | 608 } |
| 609 | 609 |
| 610 } // namespace policy | 610 } // namespace policy |
| OLD | NEW |