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/variations/active_field_trials.h" | 5 #include "components/variations/active_field_trials.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "components/variations/metrics_util.h" | 9 #include "components/variations/metrics_util.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
9 | 11 |
10 namespace variations { | 12 namespace variations { |
11 | 13 |
12 TEST(ActiveFieldTrialsTest, GetFieldTrialActiveGroups) { | 14 TEST(ActiveFieldTrialsTest, GetFieldTrialActiveGroups) { |
13 typedef std::set<ActiveGroupId, ActiveGroupIdCompare> ActiveGroupIdSet; | 15 typedef std::set<ActiveGroupId, ActiveGroupIdCompare> ActiveGroupIdSet; |
14 std::string trial_one("trial one"); | 16 std::string trial_one("trial one"); |
15 std::string group_one("group one"); | 17 std::string group_one("group one"); |
16 std::string trial_two("trial two"); | 18 std::string trial_two("trial two"); |
(...skipping 25 matching lines...) Expand all Loading... |
42 for (size_t i = 0; i < active_group_ids.size(); ++i) { | 44 for (size_t i = 0; i < active_group_ids.size(); ++i) { |
43 ActiveGroupIdSet::iterator expected_group = | 45 ActiveGroupIdSet::iterator expected_group = |
44 expected_groups.find(active_group_ids[i]); | 46 expected_groups.find(active_group_ids[i]); |
45 EXPECT_FALSE(expected_group == expected_groups.end()); | 47 EXPECT_FALSE(expected_group == expected_groups.end()); |
46 expected_groups.erase(expected_group); | 48 expected_groups.erase(expected_group); |
47 } | 49 } |
48 EXPECT_EQ(0U, expected_groups.size()); | 50 EXPECT_EQ(0U, expected_groups.size()); |
49 } | 51 } |
50 | 52 |
51 } // namespace variations | 53 } // namespace variations |
OLD | NEW |