OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/policy/cloud/component_cloud_policy_service.h" | 5 #include "chrome/browser/policy/cloud/component_cloud_policy_service.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/sha1.h" | 12 #include "base/sha1.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 16 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
17 #include "chrome/browser/policy/cloud/mock_cloud_policy_client.h" | 17 #include "chrome/browser/policy/cloud/mock_cloud_policy_client.h" |
18 #include "chrome/browser/policy/cloud/mock_cloud_policy_store.h" | 18 #include "chrome/browser/policy/cloud/mock_cloud_policy_store.h" |
19 #include "chrome/browser/policy/cloud/policy_builder.h" | 19 #include "chrome/browser/policy/cloud/policy_builder.h" |
20 #include "chrome/browser/policy/cloud/resource_cache.h" | 20 #include "chrome/browser/policy/cloud/resource_cache.h" |
21 #include "chrome/browser/policy/external_data_fetcher.h" | 21 #include "chrome/browser/policy/external_data_fetcher.h" |
22 #include "chrome/browser/policy/policy_domain_descriptor.h" | 22 #include "chrome/browser/policy/policy_domain_descriptor.h" |
23 #include "chrome/browser/policy/policy_map.h" | 23 #include "chrome/browser/policy/policy_map.h" |
24 #include "chrome/browser/policy/policy_types.h" | 24 #include "chrome/browser/policy/policy_types.h" |
25 #include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h" | 25 #include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h" |
26 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" | 26 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" |
27 #include "chrome/common/policy/policy_schema.h" | 27 #include "components/policy/core/common/policy_schema.h" |
28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
29 #include "content/public/test/test_browser_thread.h" | 29 #include "content/public/test/test_browser_thread.h" |
30 #include "net/url_request/test_url_fetcher_factory.h" | 30 #include "net/url_request/test_url_fetcher_factory.h" |
31 #include "net/url_request/url_fetcher_delegate.h" | 31 #include "net/url_request/url_fetcher_delegate.h" |
32 #include "net/url_request/url_request_context.h" | 32 #include "net/url_request/url_request_context.h" |
33 #include "net/url_request/url_request_context_getter.h" | 33 #include "net/url_request/url_request_context_getter.h" |
34 #include "testing/gmock/include/gmock/gmock.h" | 34 #include "testing/gmock/include/gmock/gmock.h" |
35 #include "testing/gtest/include/gtest/gtest.h" | 35 #include "testing/gtest/include/gtest/gtest.h" |
36 | 36 |
37 namespace em = enterprise_management; | 37 namespace em = enterprise_management; |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 Mock::VerifyAndClearExpectations(&delegate_); | 514 Mock::VerifyAndClearExpectations(&delegate_); |
515 | 515 |
516 // The policy is now being served. | 516 // The policy is now being served. |
517 PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension); | 517 PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension); |
518 PolicyBundle expected_bundle; | 518 PolicyBundle expected_bundle; |
519 expected_bundle.Get(ns).CopyFrom(expected_policy_); | 519 expected_bundle.Get(ns).CopyFrom(expected_policy_); |
520 EXPECT_TRUE(service_->policy().Equals(expected_bundle)); | 520 EXPECT_TRUE(service_->policy().Equals(expected_bundle)); |
521 } | 521 } |
522 | 522 |
523 } // namespace policy | 523 } // namespace policy |
OLD | NEW |