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" |
(...skipping 26 matching lines...) Expand all Loading... |
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 { |
44 | 44 |
45 const char kTestExtension[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; | 45 const char kTestExtension[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; |
46 const char kTestExtension2[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; | 46 const char kTestExtension2[] = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; |
47 const char kTestExtension3[] = "cccccccccccccccccccccccccccccccc"; | |
48 const char kTestDownload[] = "http://example.com/getpolicy?id=123"; | 47 const char kTestDownload[] = "http://example.com/getpolicy?id=123"; |
49 const char kTestDownload2[] = "http://example.com/getpolicy?id=456"; | 48 const char kTestDownload2[] = "http://example.com/getpolicy?id=456"; |
50 | 49 |
51 const char kTestPolicy[] = | 50 const char kTestPolicy[] = |
52 "{" | 51 "{" |
53 " \"Name\": {" | 52 " \"Name\": {" |
54 " \"Value\": \"disabled\"" | 53 " \"Value\": \"disabled\"" |
55 " }," | 54 " }," |
56 " \"Second\": {" | 55 " \"Second\": {" |
57 " \"Value\": \"maybe\"," | 56 " \"Value\": \"maybe\"," |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 Mock::VerifyAndClearExpectations(&delegate_); | 516 Mock::VerifyAndClearExpectations(&delegate_); |
518 | 517 |
519 // The policy is now being served. | 518 // The policy is now being served. |
520 PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension); | 519 PolicyNamespace ns(POLICY_DOMAIN_EXTENSIONS, kTestExtension); |
521 PolicyBundle expected_bundle; | 520 PolicyBundle expected_bundle; |
522 expected_bundle.Get(ns).CopyFrom(expected_policy_); | 521 expected_bundle.Get(ns).CopyFrom(expected_policy_); |
523 EXPECT_TRUE(service_->policy().Equals(expected_bundle)); | 522 EXPECT_TRUE(service_->policy().Equals(expected_bundle)); |
524 } | 523 } |
525 | 524 |
526 } // namespace policy | 525 } // namespace policy |
OLD | NEW |