OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/rappor/rappor_service.h" | 5 #include "components/rappor/rappor_service.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include "base/base64.h" | 10 #include "base/base64.h" |
8 #include "base/metrics/metrics_hashes.h" | 11 #include "base/metrics/metrics_hashes.h" |
9 #include "base/prefs/testing_pref_service.h" | 12 #include "base/prefs/testing_pref_service.h" |
10 #include "components/rappor/byte_vector_utils.h" | 13 #include "components/rappor/byte_vector_utils.h" |
11 #include "components/rappor/proto/rappor_metric.pb.h" | 14 #include "components/rappor/proto/rappor_metric.pb.h" |
12 #include "components/rappor/rappor_parameters.h" | 15 #include "components/rappor/rappor_parameters.h" |
13 #include "components/rappor/rappor_pref_names.h" | 16 #include "components/rappor/rappor_pref_names.h" |
14 #include "components/rappor/test_log_uploader.h" | 17 #include "components/rappor/test_log_uploader.h" |
15 #include "components/rappor/test_rappor_service.h" | 18 #include "components/rappor/test_rappor_service.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 EXPECT_EQ(2, reports.report_size()); | 132 EXPECT_EQ(2, reports.report_size()); |
130 size_t url_index = reports.report(0).name_hash() == url_hash ? 0 : 1; | 133 size_t url_index = reports.report(0).name_hash() == url_hash ? 0 : 1; |
131 size_t flags_index = url_index == 0 ? 1 : 0; | 134 size_t flags_index = url_index == 0 ? 1 : 0; |
132 EXPECT_EQ(url_hash, reports.report(url_index).name_hash()); | 135 EXPECT_EQ(url_hash, reports.report(url_index).name_hash()); |
133 EXPECT_EQ(1u, reports.report(url_index).bits().size()); | 136 EXPECT_EQ(1u, reports.report(url_index).bits().size()); |
134 EXPECT_EQ(flags_hash, reports.report(flags_index).name_hash()); | 137 EXPECT_EQ(flags_hash, reports.report(flags_index).name_hash()); |
135 EXPECT_EQ(2u, reports.report(flags_index).bits().size()); | 138 EXPECT_EQ(2u, reports.report(flags_index).bits().size()); |
136 } | 139 } |
137 | 140 |
138 } // namespace rappor | 141 } // namespace rappor |
OLD | NEW |