Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc

Issue 108563005: Move the cloud policy protobufs into the component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "components/policy/core/common/cloud/component_cloud_policy_service.h" 5 #include "components/policy/core/common/cloud/component_cloud_policy_service.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/files/scoped_temp_dir.h" 11 #include "base/files/scoped_temp_dir.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/run_loop.h" 13 #include "base/run_loop.h"
14 #include "base/sha1.h" 14 #include "base/sha1.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/stl_util.h" 16 #include "base/stl_util.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "chrome/browser/policy/proto/cloud/chrome_extension_policy.pb.h"
19 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
20 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 18 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
21 #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" 19 #include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
22 #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" 20 #include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
23 #include "components/policy/core/common/cloud/policy_builder.h" 21 #include "components/policy/core/common/cloud/policy_builder.h"
24 #include "components/policy/core/common/cloud/resource_cache.h" 22 #include "components/policy/core/common/cloud/resource_cache.h"
25 #include "components/policy/core/common/external_data_fetcher.h" 23 #include "components/policy/core/common/external_data_fetcher.h"
26 #include "components/policy/core/common/policy_map.h" 24 #include "components/policy/core/common/policy_map.h"
27 #include "components/policy/core/common/policy_types.h" 25 #include "components/policy/core/common/policy_types.h"
28 #include "components/policy/core/common/schema.h" 26 #include "components/policy/core/common/schema.h"
29 #include "components/policy/core/common/schema_map.h" 27 #include "components/policy/core/common/schema_map.h"
30 #include "net/url_request/test_url_fetcher_factory.h" 28 #include "net/url_request/test_url_fetcher_factory.h"
31 #include "net/url_request/url_fetcher_delegate.h" 29 #include "net/url_request/url_fetcher_delegate.h"
32 #include "net/url_request/url_request_context.h" 30 #include "net/url_request/url_request_context.h"
33 #include "net/url_request/url_request_context_getter.h" 31 #include "net/url_request/url_request_context_getter.h"
32 #include "policy/proto/chrome_extension_policy.pb.h"
33 #include "policy/proto/device_management_backend.pb.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;
38 38
39 using testing::Mock; 39 using testing::Mock;
40 40
41 namespace policy { 41 namespace policy {
42 42
43 namespace { 43 namespace {
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 545
546 PolicyBundle expected_bundle; 546 PolicyBundle expected_bundle;
547 const PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension); 547 const PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension);
548 expected_bundle.Get(ns).Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 548 expected_bundle.Get(ns).Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
549 base::Value::CreateStringValue("published"), 549 base::Value::CreateStringValue("published"),
550 NULL); 550 NULL);
551 EXPECT_TRUE(service_->policy().Equals(expected_bundle)); 551 EXPECT_TRUE(service_->policy().Equals(expected_bundle));
552 } 552 }
553 553
554 } // namespace policy 554 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698