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

Side by Side Diff: chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc

Issue 78763002: Move PolicyMap and its dependencies to components/policy/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export nested struct Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/metrics/histogram_samples.h" 13 #include "base/metrics/histogram_samples.h"
14 #include "base/metrics/sample_map.h" 14 #include "base/metrics/sample_map.h"
15 #include "base/metrics/statistics_recorder.h" 15 #include "base/metrics/statistics_recorder.h"
16 #include "base/run_loop.h" 16 #include "base/run_loop.h"
17 #include "base/test/test_simple_task_runner.h" 17 #include "base/test/test_simple_task_runner.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 #include "base/values.h" 19 #include "base/values.h"
20 #include "chrome/browser/invalidation/fake_invalidation_service.h" 20 #include "chrome/browser/invalidation/fake_invalidation_service.h"
21 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" 21 #include "chrome/browser/policy/cloud/cloud_policy_constants.h"
22 #include "chrome/browser/policy/cloud/cloud_policy_core.h" 22 #include "chrome/browser/policy/cloud/cloud_policy_core.h"
23 #include "chrome/browser/policy/cloud/cloud_policy_invalidator.h" 23 #include "chrome/browser/policy/cloud/cloud_policy_invalidator.h"
24 #include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h" 24 #include "chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h"
25 #include "chrome/browser/policy/cloud/enterprise_metrics.h" 25 #include "chrome/browser/policy/cloud/enterprise_metrics.h"
26 #include "chrome/browser/policy/cloud/mock_cloud_policy_client.h" 26 #include "chrome/browser/policy/cloud/mock_cloud_policy_client.h"
27 #include "chrome/browser/policy/cloud/mock_cloud_policy_store.h" 27 #include "chrome/browser/policy/cloud/mock_cloud_policy_store.h"
28 #include "chrome/browser/policy/policy_types.h"
29 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" 28 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
29 #include "components/policy/core/common/policy_types.h"
30 #include "policy/policy_constants.h" 30 #include "policy/policy_constants.h"
31 #include "sync/notifier/invalidation_util.h" 31 #include "sync/notifier/invalidation_util.h"
32 #include "testing/gmock/include/gmock/gmock.h" 32 #include "testing/gmock/include/gmock/gmock.h"
33 #include "testing/gtest/include/gtest/gtest.h" 33 #include "testing/gtest/include/gtest/gtest.h"
34 34
35 namespace policy { 35 namespace policy {
36 36
37 class CloudPolicyInvalidatorTest : public testing::Test { 37 class CloudPolicyInvalidatorTest : public testing::Test {
38 protected: 38 protected:
39 // Policy objects which can be used in tests. 39 // Policy objects which can be used in tests.
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 FireUnknownVersionInvalidation(POLICY_OBJECT_A); 841 FireUnknownVersionInvalidation(POLICY_OBJECT_A);
842 FireInvalidation(POLICY_OBJECT_A, 3, "test"); 842 FireInvalidation(POLICY_OBJECT_A, 3, "test");
843 FireInvalidation(POLICY_OBJECT_A, 4, "test"); 843 FireInvalidation(POLICY_OBJECT_A, 4, "test");
844 844
845 // Verify that received invalidations metrics are correct. 845 // Verify that received invalidations metrics are correct.
846 EXPECT_EQ(3, GetInvalidationCount(false /* with_payload */)); 846 EXPECT_EQ(3, GetInvalidationCount(false /* with_payload */));
847 EXPECT_EQ(4, GetInvalidationCount(true /* with_payload */)); 847 EXPECT_EQ(4, GetInvalidationCount(true /* with_payload */));
848 } 848 }
849 849
850 } // namespace policy 850 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698